Closed sonofevil closed 2 hours ago
Closing for now because there are some additional troubleshooting steps I want to try.
Works for me, but I tried it in Windows.
It seems that it actually works on some pages but not others.
Example script:
// ==UserScript==
// @name test script
// @namespace http://github.com
// @description does nothing
// @author sonofevil
// @include *
// @version 1
// @grant none
// @run-at document-end
// ==/UserScript==
undefined;
Doesn't work on: https://www.metal-archives.com/albums/Metallica/Ride_the_Lightning/544 Works on: https://github.com/
Again, it does work on both pages in Waterfox.
(You can tell from whether the script is greyed out in the Violentmonkey drop-down menu or not.)
Works for me on any site. Note that scripts only run when the page is created, so it won't happen on SPA sites that fake navigation by changing the URL and patching the DOM of an existing page. On those sites you can match the entire domain of the site (so it includes all possible paths) and then use MutationObserver or another API to detect changes.
Another common problem in Firefox is that it doesn't grant site permissions to extensions by default anymore and you need to do it explicitly in about:addons or in the toolbar menu for the extension.
Works for me on any site. Note that scripts only run when the page is created, so it won't happen on SPA sites that fake navigation by changing the URL and patching the DOM of an existing page. On those sites you can match the entire domain of the site (so it includes all possible paths) and then use MutationObserver or another API to detect changes.
It doesn't work even if the page is fully reloaded (ctrl+f5) so it can't be fake navigation.
Another common problem in Firefox is that it doesn't grant site permissions to extensions by default anymore and you need to do it explicitly in about:addons or in the toolbar menu for the extension.
Site permissions are fully granted.
Apparently it was somehow broken due to another script missing include resources.
It wasn't missing those resources in Waterfox, hence it worked there.
Was there a message from Violentmonkey about missing resources in console?
Was there a message from Violentmonkey about missing resources in console?
No, there wasn't, strangely enough. I only found out because when I disabled and re-enabled Violentmonkey, I got a push notification about those scripts missing resources.
Nevermind, I found it. These log entries only appear if there are missing required resources in the script:
Missing required resources. Please re-save or reinstall these script(s):
#14: Search Metal Archives entry on Bandcamp [index.js:1:141214](moz-extension://3d2a99db-4173-4f91-b6a1-4c98e3d1435c/background/index.js)
Ei moz-extension://3d2a99db-4173-4f91-b6a1-4c98e3d1435c/background/index.js:1
Li moz-extension://3d2a99db-4173-4f91-b6a1-4c98e3d1435c/background/index.js:1
Error: e is undefined
Still not sure why this breaks document-end
, but if it's a bug I think it needs a new issue cos it has nothing to do with Mercury.
I just migrated from Waterfox to Mercury browser, and some of my scripts, which used to run fine in Waterfox no longer execute in Mercury. Specifically it seems to be all of scripts that are set to run at
document-end
. The same happens withdocument-idle
. Scripts withdocument-start
ordocument-body
do seem to run, but some of my scripts don't work correctly with these options.Sequence of actions:
Problem: The userscript seemingly never runs.
Expected result: The userscript runs.
Devtools console contents: nothing related to the script or Violentmonkey
Environment: