Workaround for Firefox re-injecting content scripts when reloaded.
This commit is contained in:
parent
e4e7bbea7e
commit
c717897532
@ -4,8 +4,12 @@ Main =
|
|||||||
return if d.body and not $ 'title', d.head
|
return if d.body and not $ 'title', d.head
|
||||||
|
|
||||||
# XXX dwb userscripts extension reloads scripts run at document-start when replaceState/pushState is called.
|
# XXX dwb userscripts extension reloads scripts run at document-start when replaceState/pushState is called.
|
||||||
return if window['<%= meta.name %> antidup']
|
# XXX Firefox reinjects WebExtension content scripts when extension is updated / reloaded.
|
||||||
window['<%= meta.name %> antidup'] = true
|
try
|
||||||
|
w = window
|
||||||
|
w = (w.wrappedJSObject or w) if $.platform is 'crx'
|
||||||
|
return if '<%= meta.name %> antidup' of w
|
||||||
|
w['<%= meta.name %> antidup'] = true
|
||||||
|
|
||||||
if location.hostname is 'www.google.com'
|
if location.hostname is 'www.google.com'
|
||||||
if location.pathname is '/recaptcha/api/noscript'
|
if location.pathname is '/recaptcha/api/noscript'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user