Questions tagged [greasemonkey]

OBSOLETE as of Firefox 57. Use [greasemonkey-4] or [tampermonkey] as applicable. If using some other browser userscript engine, use [userscripts].

OBSOLETE as of Greasemonkey 4 -- which is a major change that is not backwards compatible.


Usage Hint

Use this tag if you are using Firefox, pre version 57. Use the tag if you are using Tampermonkey on Chrome. For all other userscripts, please use the tag.

GreasemonkeyMain add-on page is a userscript manager for Firefox. Userscripts are written in JavaScript, and run in every page as specified by the @include, @exclude, and @match rules.

Greasemonkey also permits special operations that ordinary javascript is not allowed to do. See the Greasemonkey API.

Userscripts are also available on/for other browsers; see the tag wiki of .
Important: Please use only if you are running the Firefox browser and/or using the add-on.
For all others, use , if it applies, or .


Premade userscripts:

Premade userscripts can be found at:


References:

2842 questions
38
votes
9 answers

How to determine why a Greasemonkey script is not running

I am trying to get a Greasemonkey script to run on a page. But it does not. How do you debug scripts? What are the smallest possible baby-steps to start a new Greasemonkey script?
Jesper Rønn-Jensen
  • 106,591
  • 44
  • 118
  • 155
37
votes
2 answers

Fire Greasemonkey script on AJAX request

I am working on a user script and I've just found that the script is not run when the main page makes AJAX requests. Is there any way to fire the user script both on main page load and on AJAX requests?
LooPer
  • 1,459
  • 2
  • 15
  • 24
36
votes
2 answers

UserScripts & Greasemonkey: calling a website's JavaScript functions

I'm creating a UserScript extension for Firefox & Chrome and I'm trying to use some of the code in the website's JavaScript, e.g.: function: myFunction(){ return Grooveshark.playNextSong(); } The problem is when I test this code, Grooveshark…
sebastian
  • 4,914
  • 2
  • 21
  • 21
35
votes
4 answers

How can I load a shared web worker with a user-script?

I want to load a shared worker with a user-script. The problem is the user-script is free, and has no business model for hosting a file - nor would I want to use a server, even a free one, to host one tiny file. Regardless, I tried it and I (of…
user5536767
34
votes
2 answers

Run Greasemonkey on html files located on the local filesystem?

I have an API documentation lying around on my Harddrive and to ease my workflow, I have written a simple script that modifies the page for my needs. I've developed it using FireBug on FireFox. @include-ing webpages works correctly, but Greasemonkey…
Niklas R
  • 16,299
  • 28
  • 108
  • 203
31
votes
2 answers

How do I restrict chrome greasemonkey scripts to a single webpage, or just certain webpages?

Is there a way to prevent chrome from running greasemonkey scripts except for on certain domains? I could do some hackery with location.href, but it would be nice if there were a cleaner solution. When I install by dragger script.user.js into the…
Stefan Kendall
  • 66,414
  • 68
  • 253
  • 406
31
votes
3 answers

how to run greasemonkey script before the page content is displayed?

I am writing a plug-in for Firefox and using greasemonkey script to do that (I compile the user script using this tool http://arantius.com/misc/greasemonkey/script-compiler). The issue is that the script is run after the page is fully loaded.…
khr2003
  • 1,055
  • 4
  • 12
  • 21
31
votes
5 answers

Stop execution of Javascript function (client side) or tweak it

I want to stop the execution of one single line from a site, so that the whole page is read by the browser except that single line. Or the browser may simply skip the execution of that javascript function. OR Is there way i can tweak the javascript…
Yousuf
  • 311
  • 1
  • 3
  • 3
30
votes
3 answers

How can I get greasemonkey to call a function on a page after it loads

I have a very simple greasemonkey script that I want to call an already existing javascript function on the page. I've read the documentation and nothing seems to work window.setTimeout(function() { alert('test') // This alert works, but…
Asa Ayers
  • 4,854
  • 6
  • 40
  • 57
29
votes
4 answers

How do I include a remote javascript file in a Greasemonkey script?

I'm trying to write a Greasemonkey script, and would like to use the jQuery library to do so, but I'm not quite sure how I would include jQuery from a web address to get rolling. How would I include jQuery (from Google's web server) into the…
tester
  • 22,441
  • 25
  • 88
  • 128
28
votes
1 answer

Including a Greasemonkey script across multiple domains

This is a bit of an oddly specific question. I'm writing a Greasemonkey script that will run across ten domains. The websites all have identical structures, but the domain name for each one is different. For example, the script will run…
blimpage
  • 393
  • 1
  • 3
  • 6
28
votes
5 answers

Create a "config" or "options" page for a Greasemonkey script

I've written a simple Greasemonkey script, and I'm trying to create a "config" page for this script (like the one that is used for Google Chrome extensions. ) Would there be any way to create a config page for a userscript, like the "options" pages…
Anderson Green
  • 30,230
  • 67
  • 195
  • 328
26
votes
7 answers

What's a simple way in Google Chrome to insert Javascript into sites?

I would like to be able to add custom snippets of javascript to any site that matches a regex. This is mostly because of sites that I use daily because of specialized content, but which have a poor design. I want to be able to do something…
bhuga
  • 1,292
  • 1
  • 14
  • 24
26
votes
1 answer

Why is window (and unsafeWindow) not the same from a userscript as from a