Questions tagged [userscripts]

Use the Tampermonkey tag if running Tampermonkey or Violentmonkey, use the "Greasemonkey-4" tag if running that engine on Firefox. For all other engines, or multi-engine scripts, use the "Userscripts" tag. Userscripts primarily refers to JavaScript extensions for web browsers, used to automate or customize actions, the layout, or other aspects of the user experience.

Userscripts primarily refers to extensions for web browsers. Userscripts can automate or customize actions, and/or they can change the layout or even "mash up" different websites.

Userscripts are commonly installed in browsers using a userscript manager add-on/extension, but some browsers have limited native support.

On most browsers, when using a userscript manager, userscripts have access to an extended API that allows some actions that are not permitted for ordinary JavaScript code running in the page scope. However, that extended API is significantly less powerful than what's available to actual browser extensions.

Userscripts are available in most browsers:

Scripts meant for Greasemonkey or Tampermonkey should be tagged or , instead.
If the userscript is meant to be cross-browser compatible (not always worth the trouble), use both and .

Userscript API changes:
For quite some time, the APIs provided by userscript managers were reasonably cross-compatible. Those APIs were synchronous, with the exception of AJAX calls. However, Greasemonkey 4.X re-wrote the APIs it presents to userscripts such that they were asynchronous, using Promises, which makes scripts using those APIs not backwards/cross-compatible. The Greasemonkey project provides a polyfill which userscripts can @require in order to write scripts using their new APIs which will function in other userscript managers.

Tampermonkey has begun to provide support for these Promise based APIs.

Resources:

1300 questions
-2
votes
2 answers

Selecting/checking the first checkbox in a td class?

I'm currently trying to figure out a way to select the first checkbox (I'm not exactly sure if it's technically a radio button) that has the following HTML on a page (http://www.swagbucks.com/polls): I have been using…
-2
votes
2 answers

.then(function) doesn't run function

I have this userscript for GreaseMonkey. I created a function (A) which calls an other function (B). I want to wait running the A function further and wait for the B function to return. Function B contains a button, so in fact I want A to wait for…
George
  • 73
  • 4
  • 15
-2
votes
1 answer

Darker Google userscript not working in Tampermonkey 4.7

I'm trying to install the Darker Google userscript in Tampermonkey 4.7 (for Safari 12), but it's not working. Since I'm a total newbie on Tampermonkey I don't really know where to put my hands on. In the Tampermonkey's dashboard I see that this…
fferri
  • 18,285
  • 5
  • 46
  • 95
-2
votes
1 answer

User Script replacing all instances of a string instead of specific instances

I've been learning about user scripts and I've been messing around with Joe Simmon's Script when I came across a problem. Say for example that I have a webpage that says 'I want to go to a park.' If I want to replace 'a' with 'the', it would produce…
jparikh97
  • 95
  • 1
  • 1
  • 9
-2
votes
1 answer

Obtain and check the value of an input text with javascript

I am fairly new with javascript and I need a script to obtain the value of an input text and check that value if it is equal to 0 (zero). If it does then I need an alert message notifying me that the text input is 0. Thanks.
Lucky
  • 9
  • 1
-2
votes
1 answer
-2
votes
1 answer

User script causes gets Facebook stuck in an endless refresh loop. How can I fix this?

I am trying to write a userscript that will remove the right panel that shows up when you play games on facebook. The idea is to get the game to take up more of the screen. When I manually edit the page using Chrome's developer tools, there are two…
Michael
  • 1,263
  • 1
  • 12
  • 28
-2
votes
1 answer

Checkbox to trigger hotkey

I need a checkbox function for a userscript in JavaScript that I'm editing. The checkbox should trigger the hotkey combination: ctrl++ I'm raw fresh at JavaScript so if you could keep it dummy simple I would apreaciate it dearly. I tried searching…
-3
votes
1 answer
-3
votes
1 answer

Get metadata of @require files in tampermonkey?

GM_info would only return info of the main script. Example: GM_info.script.name wrote inside @require file "xyz" would return "abc" which is the main script's name.
axtiv
  • 1
  • 1
-3
votes
2 answers

How to change the color of all user profile links in a page?

I'm trying to change the color of every user's profile link in my browser using a userscript. My code: // ==UserScript== // @name Color changer // @namespace http://tampermonkey.net/ // @version 0.1 // @description none // @author …
Red
  • 26,798
  • 7
  • 36
  • 58
-3
votes
3 answers

display number of users

Is there a way to show the total number of users of a network who have signed up? I just ran into an example here (at the bottom of the page on the right) and wonder how they do it...
Alex
  • 1
-3
votes
1 answer

Add a function to a button made with userscript

I know how to create a button with userscript, but I don't know how to attach a function to the button with userscript. How do I attach a function to the button with userscript? I would also like to add an "id" to the button with userscript. How do…
frosty
  • 2,559
  • 8
  • 37
  • 73
-3
votes
1 answer

Fix missing HTML tags using Greasemonkey userscript

I need to open a web page that is somehow missing .... That is, the page content is only: ... ... without the enclosing HTML tags. Firefox is willing to render this page, but not Chrome. I want to use…
edwinbs
  • 525
  • 3
  • 14
-3
votes
1 answer

Userscript to strip a portion of a pages title

IMDb's reference view was recently changed to include "- Reference View - IMDb" after the page title that only used to have Movie (year) New... Movie Title (2018) - Reference View - IMDb Old... Movie Title (2018) How…
Samuel
  • 3
  • 3
1 2 3
86
87