greasemonkey

run user script on chrome://settings and similar urls

回眸只為那壹抹淺笑 提交于 2019-12-01 19:07:30
Why doesn't tampermonkey work on urls such as chrome://history/ or chrome://settings/ ? Any way to run an user script on this pages as well? Unfortunately, this isn't possible, because the chrome scheme ( chrome:// ) isn't supported in @match 's abilities. UserScripts also use Chrome's match spec, so a Chrome extension to do that wouldn't work either. From the linked spec: Host permissions and content script matching are based on a set of URLs defined by match patterns. A match pattern is essentially a URL that begins with a permitted scheme ( http , https , file , or ftp , and that can

Semi-sandboxing Javascript eval

被刻印的时光 ゝ 提交于 2019-12-01 19:06:01
Background : I'm working on a framework/library to be used for a specific site in coordination with greasemonkey/userscripts. This framework/library will allow for addon support. The way it will work is an addon registers with the library listing required pages, resources, ectera and the library will wait until all critera is met to call the addon's load() function. The Issue :In this listing of 'required stuff' I want addon devs to be able to specify javascript(as string) to be evaluated as a 'required resource'. For example 'document.getElementById("banana")' . What I want to do is semi

Greasemonkey script is running on every web site [closed]

陌路散爱 提交于 2019-12-01 17:56:01
I set a greasemonkey script to be included on only one web site: http://example.com/* but it's running on every web site I go too.. I removed it and added it again with only 1 include but it's still running on every page, what could I be doing wrong? This is usually caused by a malformed metadata block. There must be no leading space and directives are (usually) case-sensitive. Good: // ==UserScript== // @name YOUR_SCRIPT_NAME // @include http://YOUR_SERVER.COM/YOUR_PATH/* // ==/UserScript== Bad: // ==UserScript== // @name YOUR_SCRIPT_NAME // @include http://YOUR_SERVER.COM/YOUR_PATH/* // ==

Greasemonkey script is running on every web site [closed]

我怕爱的太早我们不能终老 提交于 2019-12-01 17:48:34
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I set a greasemonkey script to be included on only one web site: http://example.com/* but it's running on every web site I go too.. I removed it and added it again with only 1 include but it's still running on every page, what could I be doing wrong? 回答1: This is usually caused by a malformed metadata block.

Script to fire an event as soon as an element exists?

◇◆丶佛笑我妖孽 提交于 2019-12-01 14:14:03
I'm trying to write a little Greasemonkey script for achieving some tasks in Facebook, like hiding news and such. The problem is: I'm having an ID to an element which isn't existing yet in the DOM. It's the little box which appears when hitting a post's arrow-icon. How can I create an event handler through jQuery which fires as soon as the element exists? Brock Adams This is a common problem. You can act on AJAXed-in elements as they appear by using the waitForKeyElements() utility . (See "Fire Greasemonkey script on AJAX request" for example.) I'm not sure what you mean by "the little box

XPath not working to click a button from a Greasemonkey script

有些话、适合烂在心里 提交于 2019-12-01 13:26:22
I would like to open a link that contains the word google . It looks like this: <input class="submit" style="background: #409999; border-radius: 10px;" value="open" onclick="Open('143615', '1', 'https://www.google.de/');" type="submit"> I tried this Greasemonkey code: var snapResults = document.evaluate("//input[contains(@onclick, 'test')]",document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = snapResults.snapshotLength - 1; i >= 0; i--) { var elm = snapResults.snapshotItem(i); // do stuff with elm if (elm) //open the window, which contains "test" { elm.singleNodeValue

Code works in console/scratchpad but not in a Greasemonkey script? [duplicate]

╄→гoц情女王★ 提交于 2019-12-01 12:51:04
This question already has an answer here: Code working in browser console but not in tampermonkey 1 answer I'm trying to write a script to make the map larger on Google Flights . I've got the jQuery working in the Firefox scratchpad. This script does exactly what I am trying to accomplish: $('div').filter(function(){ return $(this).css('width') == '648px' }).css({"width":"900px","height":"550px"}); but when I paste that into a Greasemonkey script, it doesn't work. If I add some console.logs to debug, I can verify that the script is running and the filter is working correctly, but it's not

Multiple Greasemonkey Metablocks

杀马特。学长 韩版系。学妹 提交于 2019-12-01 12:46:11
I'm trying to write a Greasemonkey script for a hierarchy of websites such that I have a bunch of code modifications for http://www.foo.com/* , then more specific ones for http://www.foo.com/bar/* , and still others for http://www.foo.com/foobar/* . Is there anyway for me to write all these in the same script, or do I have to make multiple? Is there anyway for me to write all these in the same script, or do I have to make multiple? Yes, just use those three @includes, then in your user script do something like (depends on specifics of script): var currentURL = (document.location+''); if

Greasemonkey script compiler is showing an error

走远了吗. 提交于 2019-12-01 12:32:41
I have script like this // ==UserScript== // @name messi // @namespace http://messi.com // @description example script to alert "barcelona" on userscripts page // @include http://userscripts.org/* // ==/UserScript== alert('barcelona'); this script works with Greasemonkey. I compiled this script using this link: https://arantius.com/misc/greasemonkey/script-compiler.php . After compilation I added add-on to Firefox, now it showing: Error: Illegal operation on WrappedNative prototype objec error . whats wrong ? The user script compiler wasn't updated in quite some time and the output add-ons it

Greasemonkey (using the waitForKeyElements utility) - how to call a function after a specific element has been displayed on screen

女生的网名这么多〃 提交于 2019-12-01 12:31:31
(In continuance to this question of mine ). I've been writing this userscript for the site metal-archives.com. When opening a band page ( example ) you land to DISCOGRAPHY>COMPLETE DISCOGRAPHY. My script applies to that DISCOGRAPHY tab and it's sub-tabs (COMPLETE DISCOGRAPHY, MAIN, LIVES, DEMOS, MISC) : it splits the column "Reviews" in two and makes the table sortable. I want initially (using the waitForKeyElements utility in my script in greasemonkey) a function (which adds a column to the table, based on it's contents, appendColumn(x) ) to be called after the table inside DISCOGRAPHY >