Merge pull request #3792 from toofar/fix/gm_addstyle_earlyload
Greasemonkey: fix early GM_addStyle with fast sites. Seems to be a working fix, despite noone having clarity on what is the ideal approach.
This commit is contained in:
commit
69d642cab8
@ -100,11 +100,8 @@
|
||||
|
||||
const head = document.getElementsByTagName("head")[0];
|
||||
if (head === undefined) {
|
||||
document.onreadystatechange = function() {
|
||||
if (document.readyState === "interactive") {
|
||||
document.getElementsByTagName("head")[0].appendChild(oStyle);
|
||||
}
|
||||
};
|
||||
// no head yet, stick it whereever
|
||||
document.documentElement.appendChild(oStyle);
|
||||
} else {
|
||||
head.appendChild(oStyle);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user