-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Firefox] Consider to use (programmatic) content scripts API #523
Comments
Tampermonkey doesn't use tabs.executeScript and you can enforce proper
I'l check that once it's clear that the current |
Mostly that the current implementation doesn't work reliably for document-start. E.g. I use the following script: function clearEventPROX(a) { When I go to https://mathiasbynens.github.io/rel-noopener/ I can click "Click me!!1 (same-origin)", close the opened tab and go back to first one and it's not changed (the script is working via the instant setting). However, if I reload the tab then, click again on "Click me!!1 (same-origin)" & close the opened tab, the original one is changed (message "hacked..."). Whatever workaround is used by TM to inject scripts instantly, it's not guaranteed for 100% that the script will always execute at document-start. |
@kekkc Thanks for that example. It's working reliably at Chrome, but at Firefox Tampermonkey sometimes seems to run after the (inline) page scripts were executed. I'll check that. |
Don't invest too much time, it's a known FF bug and the reason behind Content scripts API ;) Currently there seems to be no other way in FF to reliably run at document-start. |
I discovered at least one way: add a break-point to an inline script and the issue will never happen. 🙄 |
@kekkc The problem is that Tampermonkey uses a "document_start" content_script which is defined at |
Firefox implementation of WebExtensions API still has many bugs in its core parts so it wouldn't surprise me if this is yet another one. |
Sorry. I was in the wrong movie! It's just https://bugzilla.mozilla.org/show_bug.cgi?id=1376932 🙄 |
@kekkc The issue is fixed at 4.6.5741beta |
Pretty cool, thx for the quick fix ;) |
|
Current implementation of tabs.executeScript() causes many problems, e.g. no proper run-at document-start support.
Any plans to use the new, preferred Content scripts API?
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts
https://bugzilla.mozilla.org/show_bug.cgi?id=1332273
The text was updated successfully, but these errors were encountered: