Tampermonkey is the most popular userscript manager, with over 10 million users. It's available for Chrome, Microsoft Edge, Safari, Opera Next, and Firefox.
GNU General Public License v3.0
4.32k
stars
426
forks
source link
@run-at document-body/document-start may run after setTimeout() #1744
The UserScript is supposed to always prevent the navigation in gotonext().
However in Firefox, it is at least 9/10 that the navigation continues. Log shows that gotonext is already defined as function when UserScript runs.
In Chrome 111.0.5563.64 (Official Build) (64-bit):
'document-body' is similarly broken.
'document-start' seems OK, but I suspect it is similarly broken and the timing happens to be good for now.
It seems that TamperMonkey wraps UserScript as async, which I would frown upon in case of 'document-start'/'document-body'.
(The target site is NSFW and needs account, so I did not post full link)
Expected Behavior
document-body/document-start run before any setTimeout().
Actual Behavior
document-body/document-start may after setTimeout().
Specifications
Script
Webpage:
The UserScript is supposed to always prevent the navigation in gotonext().
However in Firefox, it is at least 9/10 that the navigation continues. Log shows that gotonext is already defined as function when UserScript runs.
In Chrome 111.0.5563.64 (Official Build) (64-bit):
It seems that TamperMonkey wraps UserScript as async, which I would frown upon in case of 'document-start'/'document-body'.
(The target site is NSFW and needs account, so I did not post full link)