greasemonkey

Greasemonkey: how often script check updates with @updateURL

你离开我真会死。 提交于 2019-12-22 05:46:14
问题 On monkey Wiki : "Greasemonkey will check periodically for new versions of the script by downloading it". But what does it mean? Once a week? Twice a hour? Anyone have real numbers? 回答1: According to http://www.greasespot.net/2012/02/automatic-script-updates-come-to.html, By default updates will be checked for every seven days, and automatically installed when found. 回答2: While Hellion does point to the original post when auto-update was released in early 2012 this hasn't been true for some

Local storage across domains using a Greasemonkey script

我与影子孤独终老i 提交于 2019-12-22 05:23:08
问题 Is it possible to store data across domains using a Greasemonkey script? I want to allow a Javascript object to be accessed from multiple websites that are using the same Greasemonkey script. 回答1: Yes, that is one of the purposes of GM_setvalue(), it stores data, per script , and across domains. Beware that the bog-standard GM_setValue() is somewhat problematic. It can use lots of global resources or cause a script instance to crash. Here are some guidelines: Do not use GM_setValue() to store

Why doesn't this script work with successive page clicks?

可紊 提交于 2019-12-22 00:36:00
问题 I am currently using the following script in Tampermonkey in Google Chrome: // ==UserScript== // @name Youtube opt in Ads per channel // @namespace schippi // @include http://www.youtube.com/watch* // @version 1 // ==/UserScript== var u = window.location.href; if (u.search("user=") == -1) { var cont = document.getElementById("watch7-user-header").innerHTML; var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,''); window.location.href = u+"&user="+user; } It seems to work perfectly

How to replace @media (max-width) using Stylish or Greasemonkey?

断了今生、忘了曾经 提交于 2019-12-21 21:40:02
问题 I'm having a problem viewing this website on my desktop browser. They have a responsive/fluid design that shows a mobile menu button instead of a horizontal nav-bar when the browser width is less than 990px. Since I'm using Firefox with 125% zoom, my desktop browser is less than 990px effective width. I looked into the CSS code and found the line. How can I use Stylish, Greasemonkey, or some other way to automatically replace the max-width value of "990px" with "800px"? @media (max-width

Userscript to bypass same-origin policy for accessing nested iframes

十年热恋 提交于 2019-12-21 20:54:42
问题 In the following HTML mockup, the nested iframes are originating from different subdomains. This is causing messages such as error: Permission denied to access property "document" <html> <head> <title></title> </head> <body> <div> <iframe id="outer_iframe_1" src="https://subdomain1.example.com"></iframe> </div> <div> <iframe id="outer_iframe_2" src="https://subdomain2.example.com"> <div> <iframe id="inner_iframe_2" src="https://subdomain4.example.com"></iframe> </div> </iframe> </div> <div>

Capture keypress in Javascript (Google Docs)

孤者浪人 提交于 2019-12-21 19:56:55
问题 I'm trying to write a little greasemonkey script/bookmarklet/what have you for Google Docs. The functionality I'd like to add needs a keypress/keyup/keydown event handler (one of those three). Unfortunately, Javascript isn't my forté, and I can't seem to capture (?) a keypress event to while in the edit pane. As a last resort, I've tried the following: javascript:(function(){ els = document.getElementsByTagName("*"); for(i=0;i<els.length;i++){ els[i].onkeypress=function(){alert("hello!");};

Userscript to click button

ぃ、小莉子 提交于 2019-12-21 18:33:08
问题 I would like to click a buy now button using greasemonkey. // ==UserScript== // @name script // @namespace sc // @include * // @version 1 // @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== waitForKeyElements ("#buy-now", triggerMostButtons); function triggerMostButtons (jNode) { triggerMouseEvent (jNode[0], "mouseover"); triggerMouseEvent (jNode[0],

Accessing Greasemonkey metadata from within your script?

点点圈 提交于 2019-12-21 07:50:44
问题 Is there any way that my script can retrieve metadata values that are declared in its own header? I don't see anything promising in the API, except perhaps GM_getValue() . That would of course involve a special name syntax. I have tried, for example: GM_getValue("@name") . The motivation here is to avoid redundant specification. If GM metadata is not directly accessible, perhaps there's a way to read the body of the script itself. It's certainly in memory somewhere, and it wouldn't be too

Load remote URL with Greasemonkey and jQuery

随声附和 提交于 2019-12-21 06:30:03
问题 I'm trying to perform an Ajax query from within a Greasemonkey script, but I'm stuck with not being able to load data from a remote URL. The script only seems to function if the page being viewed is the same domain as the Ajax call. Example: // ==UserScript== // @name Hello jQuery // @namespace http://www.example.com/ // @description jQuery test script // @include * // @require http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js // ==/UserScript== $(document).ready(function() { $.get(

How to debug Greasemonkey script on Firefox 30?

蹲街弑〆低调 提交于 2019-12-21 05:38:05
问题 I've been developing a JavaScript snippet for Youtube which uses Greasemonkey, and also imports Bootstrap and jQuery libraries. This application has to add a button for each one of the search list results and when the user clicks it, it must bring the user uploaded videos from his channel. I've tested the button and it works well on Firefox 29. Nevertheless, recently I updated Firefox to version 30, and now I'm unable to see/debug the code I wrote, although Firefox executes it. I'd like to