r/GreaseMonkey • • Feb 10 '22

TamperMonkey script does not run ...

My TamperMonkey script doesn't run ... but when you take the code and run it in the Chrome Dev Console -- it runs fine, and does exactly what I need ... any idea why it is not running in the browser plugin?

I made a StackOverFlow post with a lot more details, code views, and screenshots, but no responses :

https://stackoverflow.com/questions/70993495/tampermonkey-script

Maybe this community can help. Thanks!

14 Upvotes

34 comments sorted by

2

u/AyrA_ch Feb 10 '22

Visit the page where the script is supposed to run, then click on the tampermonkey icon next to the address bar. Is the script listed in the drop down and marked as enabled?

2

u/misteralexander Feb 10 '22

This is the plugin dropdown in the browser, when I navigate to the page in the `@match` section: https://imgur.com/Jn5OplA

This is the TamperMonkey dashboard: https://imgur.com/ru1JaV3

It says no script is running but the URL and the match string are the same!

3

u/AyrA_ch Feb 10 '22

The match string can be a bit of a bitch to get right. Try to add * to the end of it.

Also I've just seen that you @require jquery in your script, but you're not actually using jquery in the code on stackoverflow. Consider removing that line. Also for the future: Always load external resources over https, never over http.

1

u/misteralexander Feb 11 '22 edited Feb 11 '22

Here is the new code, with the asterik at the end of the URL:

https://i.imgur.com/sefH7SI.png

Here is the browser, showing the full URL that matches the TamperMonkey code.

https://i.imgur.com/WARk1sG.png

The plugin still shows "No script running" when I load the QNAP login page. :-(

2

u/AyrA_ch Feb 11 '22

Well, you deleted the / at the end of the match that was there before. The asterisk is limited in where it can go: https://developer.chrome.com/docs/extensions/mv2/match_patterns/

1

u/misteralexander Feb 11 '22

The slash " / " did it. It works now!!!

THANKS SO MUCH!

2

u/[deleted] Feb 27 '24

when i put asterik slash it just says no script running

2

u/ApopheniaPays Feb 13 '23

B-boom. I made the same mistake, this tip fixed it for me too. Thanks.

0

u/srfeeollyaiexamzn Jul 07 '25

why are you posting code with imgur?

1

u/Temporary-Judge-7260 Mar 14 '25

it's not, how do i run it

1

u/King_Joker360 Nov 21 '22

Hi. My tampermonkey is saying no scrips is running, Please help me fix this.

1

u/misteralexander Nov 21 '22

For me, the issue ended up being the site whitelist that fixed it. Check that out.

1

u/Square_Promise6401 Nov 30 '22

No script is running error when I run a script

2

u/toby-martin Oct 05 '23

In case this helps someone I stumbled across another reason scripts don't run - I accidentally deleted the (); that ends every Tampermonkey script in a random act of editing vandalism. There were no errors from Tampermonkey, nor from the site where the script was injected but nothing worked.

1

u/Aspie_Astrologer Aug 19 '24

Thank you. This was my problem!

1

u/jcunews1 Feb 10 '22

What code?

Make sure the script's @match or @include metadata is properly set.

1

u/[deleted] May 15 '23

THANK YOU

1

u/UmpireFragrant9669 Apr 18 '24

why does it say (tampermonkey has no access to this page??

1

u/Smorfty Jun 20 '24

On my match I had written "https://example.com/*" but the sites actual adress was "https://www.example.com/".

Chrome had hidden the "www." part in the address bar.

1

u/893hf89ehf Aug 09 '24

in opera i have to always go to "manage extension" and turn off "Allow access to search page results" and turn it on again. then it works for current open window. if i close opera and reopen it, i have to repeat the turn off and turn on step again. any idea why? in chrome it works fine. just in opera. thanks

1

u/Fabulous-Spread3511 Dec 17 '24

Script isnt working in the site where it is supposed to

1

u/Fabulous-Spread3511 Dec 17 '24

Dk whats wrong, anybody help?

1

u/Ok-Tea-2218 Oct 20 '25

click gauche sur l'extension tampermonkey clic gauche et active: Autoriser les scripts utilisateur

L'extension pourra exécuter du code qui n'a pas été examiné par Google. Cette option pouvant être dangereuse, ne l'activez que si vous êtes sûr de vous.

1

u/Ok-Tea-2218 Oct 20 '25

click gauche sur l'extension tampermonkey clic gauche et active: Autoriser les scripts utilisateur

L'extension pourra exécuter du code qui n'a pas été examiné par Google. Cette option pouvant être dangereuse, ne l'activez que si vous êtes sûr de vous.

1

u/Black_boy_Ants Apr 01 '25

check if developer mode is enabled

1

u/Ok-Tea-2218 Oct 20 '25

g trouvé c du a un controle de securité opera non present chez chrome ou autres

1

u/Ok-Tea-2218 Oct 20 '25

click gauche sur l'extension tampermonkey clic gauche et active: Autoriser les scripts utilisateur

L'extension pourra exécuter du code qui n'a pas été examiné par Google. Cette option pouvant être dangereuse, ne l'activez que si vous êtes sûr de vous.

voilà

1

u/KULKING Nov 26 '25

If someone faces this issue in the future, this is what fixed it for me in Chromium based browsers.

Go to manage extensions -> tampermonkey -> Enable Allow user scripts

1

u/creamsoup1221 Dec 03 '25

You are the goat

1

u/Vikkskid Dec 12 '25

Mine is still not working idk what to do

1

u/Worth_Bar148 May 10 '26

GOAAAAAAAT AHAHAHAHAH IT WAS SO SIMPLE THANK YOU

1

u/King_Joker360 Nov 21 '22

Ok thank you very much

1

u/King_Joker360 Nov 21 '22

I'll check it out