Fix compatibility with Tampermonkey, close #33

This commit is contained in:
Nicolas Stepien 2011-12-09 14:07:26 +01:00
parent 3024346b94
commit 4cfa27f38c
3 changed files with 5 additions and 4 deletions

View File

@ -3012,7 +3012,7 @@
g.PAGENUM = parseInt(temp) || 0; g.PAGENUM = parseInt(temp) || 0;
} }
if (location.hostname === 'sys.4chan.org') { if (location.hostname === 'sys.4chan.org') {
if (d.body) { if (/interactive|complete/.test(d.readyState)) {
qr.sys(); qr.sys();
} else { } else {
$.on(d, 'DOMContentLoaded', qr.sys); $.on(d, 'DOMContentLoaded', qr.sys);
@ -3054,7 +3054,7 @@
if (conf['Quote Backlinks']) quoteBacklink.init(); if (conf['Quote Backlinks']) quoteBacklink.init();
if (conf['Indicate OP quote']) quoteOP.init(); if (conf['Indicate OP quote']) quoteOP.init();
if (conf['Indicate Cross-thread Quotes']) quoteDR.init(); if (conf['Indicate Cross-thread Quotes']) quoteDR.init();
if (d.body) { if (/interactive|complete/.test(d.readyState)) {
return Main.onLoad(); return Main.onLoad();
} else { } else {
return $.on(d, 'DOMContentLoaded', Main.onLoad); return $.on(d, 'DOMContentLoaded', Main.onLoad);

View File

@ -1,6 +1,7 @@
master master
- mayhem - mayhem
fix favicon updating on Opera fix favicon updating on Opera
fix compatibility with Tampermonkey
2.23.0 2.23.0
- mayhem - mayhem

View File

@ -2328,7 +2328,7 @@ Main =
g.PAGENUM = parseInt(temp) or 0 g.PAGENUM = parseInt(temp) or 0
if location.hostname is 'sys.4chan.org' if location.hostname is 'sys.4chan.org'
if d.body if /interactive|complete/.test d.readyState
qr.sys() qr.sys()
else else
$.on d, 'DOMContentLoaded', qr.sys $.on d, 'DOMContentLoaded', qr.sys
@ -2404,7 +2404,7 @@ Main =
quoteDR.init() quoteDR.init()
if d.body if /interactive|complete/.test d.readyState
Main.onLoad() Main.onLoad()
else else
$.on d, 'DOMContentLoaded', Main.onLoad $.on d, 'DOMContentLoaded', Main.onLoad