greasemonkey

How to replace image links with img src url in Greasemonkey

烂漫一生 提交于 2019-12-20 05:11:12
问题 From the title this may sound like a duplicate question. But what I am asking for is help writing a Greasemonkey script that takes all images containing the word "thumbnails" in the src url, replaces "thumbnails" with "images" but then putting the new url into the href (target) url. What I have so far is: for(var iImage=0;iImage<document.images.length;iImage++){ var imageUrl = document.images[iImage].src; if (imageUrl.indexOf("thumbnails") != -1) { imageUrl = imageUrl.replace("thumbnails",

Looping GM_xmlhttpRequest gives “TypeError Null” on a variable

眉间皱痕 提交于 2019-12-20 04:24:32
问题 I have some links in a page. I want to count the responses of each link and insert the numbers in front of the links. Here is what I have: var links = document.evaluate('..../td[1]/font//a[@href]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); var headings = document.evaluate('.../td[1]',document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null) for(var i = 0; i < links.snapshotLength; i++){ var urls = links.snapshotItem(i).href; GM_xmlhttpRequest({ method: 'GET', url:

greasemonkey script to select radio button

我只是一个虾纸丫 提交于 2019-12-20 04:12:01
问题 i'm new here. i've a question related to greasemonkey. A page contain multiple radio buttoned values and one choice is to made, this correct choice option is hidden within the page the radio buttons are present in the form whose structure is <form name="bloogs" action="/myaddres.php" id="bloogs" method="post" > then the hidden field as <input type=hidden value="abcd" name="ans"> then all the radio button values are followed as <input type="radio" id="r1" name="opt" value="abcd"> abcd <input

Replace the directory of an image src, using Javascript

做~自己de王妃 提交于 2019-12-20 03:32:31
问题 I'd like to replace the directory of an image src , changing .*pinterest.com/192/ to .*pinterest.com/550/ . I had been trying to modify this code to change the directory name instead of just removing the "_b" part of the filename. document.getElementById("chrome") .addEventListener("DOMNodeInserted", function (a) { if (a.target.tagName && a.target.tagName == "DIV" && /entry\s?/.test(a.target.className)) { var b = a.target.getElementsByTagName("img"); for (var c in b) { var d = b[c]; if (/.

Getting jQuery and GM_addStyle to work in a Chrome userscript based off of a working Greasemonkey script

倾然丶 夕夏残阳落幕 提交于 2019-12-20 02:54:57
问题 I wrote a simple Greasemonkey script that enlarges thumbnail pictures in a flyover popup. It uses a lot of jQuery in it. It works just fine on Firefox. But not on Chrome since it doesn't support @require. I came across this solution for this matter. But the script didn't work on Chrome even after I integrated it with the get-around code. I just put all my script code inside the solution code's main function. Is it wrong? If anyone can point out where is the problem, and what I can do to get

Switching off `@grant none` breaks my Greasemonkey script?

左心房为你撑大大i 提交于 2019-12-19 21:50:02
问题 I'm running this script on the Facebook homepage. It gets all the conversations in the dock in the bottom and gets their __FB_TOKEN s. // ==UserScript== // @name MyScript // @namespace MyNameSpance // @include /https?://(www.)?facebook.com(/.*)?/ // @require http://code.jquery.com/jquery-2.1.0.min.js // @version 0.0.0 // @grant none // ==/UserScript== (function () { // Don't run on frames or iframes if (window.top != window.self) { return ; } window.addEventListener('load', function () { var

Semi-sandboxing Javascript eval

落花浮王杯 提交于 2019-12-19 19:56:41
问题 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

How to autoupdate a forum thread when new posts?

感情迁移 提交于 2019-12-19 11:24:06
问题 Greasemonkey plugin. (js/ajax, jquery optional). Want to autoupdate forum pages when they get changed (new posts, for instance). Ideally with no page refresh. Additionally, if I can make it load multi-page threads in one page (when applicable, perfect). Don't want to lose content in response boxes if there's any text in them. Site: Paizo.com. How would you guys go about doing this? 回答1: loop GM_xmlhttpRequest to get the forum page in a 15 minutes interval. save the response, and compare with

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

对着背影说爱祢 提交于 2019-12-19 11:20:05
问题 (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

Greasemonkey script compiler is showing an error

强颜欢笑 提交于 2019-12-19 10:53:46
问题 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