jesus2099 / konami-command

power‐ups for various web sites
117 stars 25 forks source link

Tampermonkey silently fails when no include or match #821

Closed jesus2099 closed 1 month ago

jesus2099 commented 1 month ago

Tampermonkey decided to not run userscripts with no @match and no @include directives, for reasons:

https://github.com/Tampermonkey/tampermonkey/issues/1766#issuecomment-1516740141

Running without any @match or @include is counter-intuitive and even can open security holes (e.g. by intentional misspelling). That's why this behavior was changed in 2016. http://tmnk.net/changelog.php?show=gcal&more=true#v4.0.5090

But the problem is that, all of a sudden, many userscripts silently stopped to operate. And they keep on not running, without warnings or errors, not even at install or update time.

I found these such scripts in my repo:

They run in Greasemonkey and Violentmonkey, but no longer in Tampermonkey.

~Solution is to add either // @match *://*~ (No: Invalid per Google specs) ~or // @include *~ (No: Regex would be better) ~to the metadata block.~

Or rather either // @match *://*/* or // @include /^https?:\/\//.

I don't have time right now to decide which one is best...

jesus2099 commented 1 month ago

It was spotted by @jerry1970, Tampermonkey user.