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.29k
stars
424
forks
source link
Global variables become unavailable in functions, some things get executed/evaluated out of order? #2178
Hold the effing phone.
I just realized that a @require script calls a function of the same name as this one (doit) 🤦♀️
I was not expecting that to happen.
Sorry for the confusion 😵
Expected Behavior
Variables in global scope stay available and things are executed/evaluated in the expected order. In Example script:
doit
, because it never gets executed, anddoit
got executed, the error of "error is not a function" is not thrown, because it was defined in global space as a functionActual Behavior
Variables are undefined, An absolute chaotic nightmare 😵 In Example sctipt:
doit
is executedSpecifications
Script
site: https://example.com/