greasemonkey

:contains() does not return the expected nodes

安稳与你 提交于 2019-12-11 09:53:52
问题 Please, consider the following code: // @include /(^https?:\/\/www\.|^https?:\/\/)google\.com(\.|\/).*/ // @include /(^https?:\/\/www\.|^https?:\/\/)stackoverflow\.com\/.*/ // @include /(^https?:\/\/www\.|^https?:\/\/)userscripts-mirror\.org\/.*/ // @include http://wiki.greasespot.net/* // @version 1.0 // @require https://code.jquery.com/jquery-2.1.1.min.js // @grant GM_addStyle $ ( 'body:contains("serscripts.org")').each ( function () { var results = $(this); var text = results.text();

Javascript Value composed of several words [value=dog crazy]

人盡茶涼 提交于 2019-12-11 09:29:35
问题 thanks for the help in this forum, I was able to get my code to work: // ==UserScript== // @name PARINGO // @description Auto select rpt radio button // @namespace PARINGO // @include https://docs.google.com/spreadsheet/viewform?formkey=dG1fdUU1bTR5R1l3dmtGS095QVYxZlE6MQ // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @grant GM_addStyle // @version 1 // ==/UserScript== /*- The @grant directive is needed to work around a design change introduced in GM 1.0. It

Javascript page load delay of specific set of pages

余生长醉 提交于 2019-12-11 09:18:07
问题 I want to delay a specific set of webpages using a small greasemonkey script. Basically, if the website being loaded is part of a set of pages, then I want to delay the time the page takes to load. e.g. if the page being loaded is "http://www.a.com/","http://www.a.com/b", etc. then I want to delay the load by 30 secs. 回答1: Assuming that Dushara's comment is correct: "See xkcd.com/862 for what the poster wants. (Hover the mouse over the image to see the reasoning). In fact, I found this

How can I rewrite links with JavaScript or jQuery and a regular expression?

旧街凉风 提交于 2019-12-11 08:26:33
问题 Looking to modify Yahoo Answers links to remove some parts, saving just the qid and replacing index with answer . So this: http://answers.yahoo.com/question/index;_ylt=AhT5ZZwbMiGWdQZDSxD1ML305nNG;_ylv=3?qid=20121004094847AAjekoj becomes this: http://answers.yahoo.com/question/answer?qid=20121004094847AAjekoj I know there are ways to rewrite links with .htaccess but in this case, it would need to be a Greasemonkey script since the task would be done on sites I visit, and not my websites. 回答1:

greasemonkey currency converter

穿精又带淫゛_ 提交于 2019-12-11 07:57:03
问题 I m making a greasmonkey script to convert currency in a specific page to INR using API. I am able to get the current currency rate of USD-INR and also able to replace currencies symbols to INR but m not able to convert the currency value to current rate. I am using this script: $(function(){ GM_xmlhttpRequest({ method: "GET", url: "http://www.google.com/ig/calculator?hl=en&q=1usd=?inr", onload: function(d){ d=JSON.stringify(eval("(" + d.responseText + ")")); d=$.parseJSON(d); p=Math.round(d

Automatic click on a pop up button

白昼怎懂夜的黑 提交于 2019-12-11 07:34:19
问题 I've the following button that appear suddenly on a window. <span class="a b c" id="PulsingButton_6_label" data-dojo-attach-point="containerNode">Accept Waiting Chat</span> Would be possible to intercept it and automatically click on it? I was thinking at something in JS or a greasemonkey extension. Ideas? 来源: https://stackoverflow.com/questions/42553882/automatic-click-on-a-pop-up-button

javascript cloneNode with events

女生的网名这么多〃 提交于 2019-12-11 07:27:12
问题 I am working on a greasemonkey script for gmail where i need to make a copy of the "Inbox" link. Using cloneNode works ok, but i think there's an onclick event that gets attached to it at runtime. So, this is a two part question: 1. Is there a way to see what events are attached to a node? 2. Is there a way to copy those events as well? The closest thing i found was jQuery, and i am not ready to go there yet. Thanks! 回答1: Not unless it's set using the onclick attribute on the element. Not

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

坚强是说给别人听的谎言 提交于 2019-12-11 06:07:57
问题 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? 回答1: 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

How can I refine this Javascript code to refine it so it only work on links from images (and NOT links from text)

耗尽温柔 提交于 2019-12-11 05:46:41
问题 I want to make some refinement to some code from a previous question: // the new base url var base = ' https://www.example.co.uk/gp/wine/order?ie=UTF8&asin='; var links = document.getElementsByTagName('a'); for(var i = 0;i < links.length;i++){ // check each link for the 'asin' value var result = /asin=([\d\w]+)/.exec(links[i].getAttribute('href')); if(result){ // make a new url using the 'base' and the 'asin' value links[i].setAttribute('href', base+result[1]); } } Now, instead of it acting

Need help debugging greasemonkey script

左心房为你撑大大i 提交于 2019-12-11 05:07:32
问题 I'm quite new here, and just as new with GM scripting. With the help of some of the members here, Brock and others, I'm making progress. I currently have the problem of debugging Greasemonkey scripts, but for some reason I'm not getting the hang of it. My first problem, to debug using console.log for firebug. Sometimes I find the logs, most of the times I cant find anything there, guess I'm using it wrongly. Then trying to use alert in order to see variable values... same story. I'm currently