The reason the onload HTML attribute wouldn’t work is because the CSP (Content Security Policy) is set to script-src 'self' which only allows running js from .js files hosted on the same scheme, host and port.
Also, the following restrictions apply:
**You cannot use inline JavaScript.**
You cannot load any asset or connect to any resource that is not served over a secure protocol (HTTPS or WSS).
You cannot embed an extension anywhere outside the Twitch extension harness.