Steps:
- Use document.write to include JS.
- Use document.write (not in onload!) to create dynamic CSS.
Example script attached.
I know what you think about document.write, but the bottom line is that it used to work and it was a valid usage. If there is a workaround for that then I'm not aware of it.
Note that the CSS rules are dynamic and they must be visible (created and loaded) BEFORE the page is ready. This is the only way the page won't flicker upon loading.
Version: 1.18.x
Severity: major
URL: http://pl.wikipedia.org/w/index.php?title=Wikipedysta:Nux/hideSidebar.dev.js&action=raw&ctype=text/javascript&dontcountme=s
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=45574
https://bugzilla.wikimedia.org/show_bug.cgi?id=52797