Questions tagged [greasemonkey-4]

Greasemonkey 4 is a major milestone, breaking most of the Greasemonkey scripts for earlier versions (although a polyfill restores some compatibility).

Note that for maximum compatibility of existing scripts, Greasemonkey recommends that you switch to Tampermonkey or Violentmonkey:

As mentioned in the main post, Greasemonkey 4 is changing how it runs user scripts. Many user scripts will continue to run as expected, but this will break some scripts. If you rely on such scripts, you might want to install Violentmonkey or Tampermonkey, both of which provide better compatibility for existing scripts.


Additional references:

97 questions
1
vote
1 answer

How replacing Element prototype method?

What should I do to make it work in greasemonkey?: Element.prototype._attachShadow = Element.prototype.attachShadow; Element.prototype.attachShadow = function () { return this._attachShadow( { mode: "open" } ); }; Now, when I use…
lukaszpolowczyk
  • 605
  • 1
  • 7
  • 27
1
vote
1 answer

Greasemonkey Script Failing To Remove Element

A lot of this script is basically cut and paste from other people's scripts that are working for them, but I'm having a strange issue with either .remove or .removeChild failing to run. The script crashes out the userscript engine at this point. //…
Colin
  • 47
  • 4
1
vote
0 answers

GM object not available in firefox debugger console

Unable to get access to the GM object in the Firefox debugger console. // ==UserScript== // @name test_script // @version 1 // @grant none // @include * // ==/UserScript== document.GM = GM; // The GM object can not be accessed using…
Talespin_Kit
  • 20,830
  • 29
  • 89
  • 135
1
vote
1 answer

Using the same userscript to run different code at different URL's

I know it is possible to run a script on different URL's by adding @include statements, but it is possible to run different sets of code based on the URL? My script currently works properly but I had to break it into 5 separate userscripts and it…
1
vote
3 answers

How to use Greasemonkey to selectively remove content from a website?

I have tried removing content (paid content) from this website with uBlock origin, Greasemonkey and Anti-Adblock Killer script. I have tried running this script but without success. The ("paid") content I want to remove looks like this:
Cikson
  • 106
  • 2
  • 17
1
vote
0 answers

Why is DomParser having issues in Firefox?

I am writing a Greasemonkey script; it works great in Chrome, but has issues only in Firefox. I am using the following code to parse a response using xmlHTTPRequest: var parser = new DOMParser (); var responseDoc = parser.parseFromString…
jimjamian
  • 93
  • 1
  • 10
1
vote
0 answers

How to access global window object in Greasemonkey 4?

I updated my browser, and without any warning, most of my user-scripts are broken. This is mostly because, suddenly, I cannot access properties from the page's global window objects that were defined by page scripts (native properties are…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
1
vote
1 answer

Blank Private Browsing Page in Firefox

I would like to write an WebExtension to have a blank private browsing page, inspired by an old extension: https://github.com/iPotable/BlankPrivateBrowsingPage I thought I could use chrome_url_overrides for any chrome page. So I tried: { …
Wuff
  • 257
  • 1
  • 8
0
votes
0 answers

How to automatically dowload Tampermonkey scripts from basic-auth sites

I have a Tampermonkey script e.g. under https://my.site/reserved/blah.user.js. A basic-auth authentication is needed to download the file from there. I added to the script the directives // @updateURL https://my.site/public/blah.meta.js //…
Sampisa
  • 1,487
  • 2
  • 20
  • 28
0
votes
1 answer

Want to make Google-search page automatically show more definitions by setting attribute "aria-expanded" to "true" on page load

I always want to see the expanded section when searching for a definition, so I would like it to automatically expand upon loading the page. Using Tampermonkey to create a userscript that applies to google.com/search?q=meaning+* From inspecting page…
0
votes
0 answers

Violentmonkey Script to Redirect Page

I'm trying to write a script that saves a url and a custom message for said url, and when I visit the url, it will redirect me to a new page with the custom message and a button to proceed to the page if I want. So far this is what I have- //…
0
votes
1 answer

Violentmonkey How to compress string

I am relatively new to Javascript and am currently making a Violentmonkey script. In my script I have a relatively big string that I want to compress but I don't know how I would do that since most methods I found only where using external libraries…
0
votes
1 answer

Reusing userscript code on different site structures?

A lot of websites have the concept of pagination. I'd like to be able to go to the next/previous page by hitting the right/left key, respectively. I've figured this out for one site, but it's kind of inconvenient to write a general purpose solution…
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
0
votes
1 answer

My script will run in the console, but I can not get it to run in Greasemonkey

I'm about to rip my hair out with this. This code will execute just fine in the browser console, but it simply will not run with Greasemonkey or Tampermonkey. I've tried them both and I'm out of ideas as to what could be wrong. ADDENDUM FOR…
0
votes
2 answers

Remap arrow keys to another keys with JavaScript on GreaseMonkey/TamperMonkey

I'm trying to set up a TamperMonkey script to reassign the Right Arrow key to F key. I tried this code, but so far, nothing happens when I press F. (function(){ document.addEventListener('keydown', function(e) { // pressed F if (e.keyCode ==…
oppala
  • 47
  • 7