How to edit Tampermonkey scripts outside of the browser

Go to Extensions > Tampermonkey > Allow access to file urls Then, set your script as: // ==UserScript== // @name Acecool – Video Site – Ultimate Video Site Management, Ad Removal, Redirection, Direct-Linking and more! // @author Acecool // @namespace Acecool // @version 0.0.1 // @description Replaces encoded-links with decoded direct-links on episode finder sites. … Read more

Run Greasemonkey script on the same page, multiple times?

The simplest, most robust way is to use the waitForKeyElements() utility. Here is a complete script that uses jQuery and waitForKeyElements to alter Amazon search results: // ==UserScript== // @name _Amazon Search, alter results // @include http://www.amazon.com/s/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @require https://gist.github.com/raw/2625891/waitForKeyElements.js // @grant GM_addStyle // ==/UserScript== /*- The @grant directive is needed to … Read more

Where are Chrome/Tampermonkey userscripts stored on the filesystem? [closed]

Tampermonkey scripts are super easy to update via the Tampermonkey tab. See the Tampermonkey FAQ, or just try it. Tampermonkey scripts were stored in a special SQLite database and were/are not directly editable in file form. Update: As of version 3.5.3630, Tampermonkey scripts are now stored using Chrome’s extension storage. They are still not editable … Read more

Develop Tampermonkey scripts in a real IDE with automatic deployment to OpenUserJs repo

I found my way to it, so it’s not official or anything. And it’s easier than it looks, I just wanted to be thorough. We are just instructing the browser and Tampermonkey (TM) to load the script in our file system, which we’ll then edit directly. Coding to instant updates 👨‍💻 Go to Chrome => … Read more

How can I develop my userscript in my favourite IDE and avoid copy-pasting it to the Tampermonkey’s editor every time?

I found my own way to it, so it’s not official or anything, feel free to make your own adjustments. You’ll be able to code in your editor and see the changes reflected in the browser without a nuisance. Set up We’ll make our TM script to be without code but @require a local file. … Read more

How/Where to store data in a Chrome Tampermonkey script other than localStorage?

Since you are using Tampermonkey (Chrome) and Greasemonkey (Firefox). Go ahead and use GM_setValue(). It cannot be cleared by Facebook or by any other website. It has the advantage of storing values cross-domain, as well. ~~~ Beware that the bog-standard GM_setValue() is somewhat problematic on Firefox. It can cause a script instance to crash on … Read more

GM_addStyle equivalent in TamperMonkey

Version 4.0 or +, update of 2018 ReferenceError: GM_addStyle is not defined You need to create your own GM_addStyle function, like this : // ==UserScript== // @name Example // @description Usercript with GM_addStyle method. // ==/UserScript== function GM_addStyle(css) { const style = document.getElementById(“GM_addStyleBy8626″) || (function() { const style = document.createElement(‘style’); style.type=”text/css”; style.id = “GM_addStyleBy8626”; document.head.appendChild(style); … Read more

Why is usage of the downloadURL & updateURL keys called unusual and how do they work?

Use of those keys is discouraged mainly by Greasemonkey’s lead developer. Most others, including the Tampermonkey team feel no need for such a warning. Also note that those directives are not always required for auto-updates to work. Some reasons why he would say that it was unusual and that “most” scripts should omit it: In … Read more

Chrome 65 blocks cross-origin . Client-side workaround to force download?

According to the discussion blob: and data: URLs are unaffected, so here is a workaround using fetch and Blobs. Client-side force download media function forceDownload(blob, filename) { var a = document.createElement(‘a’); a.download = filename; a.href = blob; // For Firefox https://stackoverflow.com/a/32226068 document.body.appendChild(a); a.click(); a.remove(); } // Current blob size limit is around 500MB for browsers … Read more

Greasemonkey/ Tampermonkey @match for a page with parameters

@match only works on the protocol/scheme, host, and pathname of a URL. To trigger off the query parameters, you can either use @include or use @match and also test the URL yourself. Note that the @match approach performs faster. With @include, you can use a regex syntax. See, also Include and exclude rules. In this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)