greasemonkey

Replace jQuery version of a page with Greasemonkey

China☆狼群 提交于 2019-11-30 01:01:07
How can i replace jquery version of a page with greasemonkey? Im trying to test a site with a newer version of jquery but i dont have a dev enviroment. I know you're asking about jQuery and Greasemonkey for doing this, but let me off a completely different alternative, Fiddler . If you're testing a site out with a new version of jQuery and you actually want to test any breaking changes, etc...you want to test the site as it will be , whereas a JavaScript (greasemonkey)-based after-the-fact replacement isn't an accurate simulation. With fiddler you can replace the jQuery file that the browser

How can I craft a GreaseMonkey-like script to show a different page in the lower-third?

牧云@^-^@ 提交于 2019-11-29 23:20:23
问题 If you take a look at this page, there's a lot of white space in the bottom. I wish to use Greasemonkey-like script on that page, that utilises some of that white space and loads another page there (using something like an iFrame). The URL that I want to be loaded in that iFrame-type-thing (in the lower third) is always whatever View Amazon Product Page is pointing to. So, I want the code to look at the page, and find where that link points to. (As this is the bit that varies) I want the

Replace remote JavaScript file with a local debugging copy using Greasemonkey or userscript

旧巷老猫 提交于 2019-11-29 20:55:40
While debugging a client app that uses a Google backend, I have added some debugging versions of the functions and inserted them using the Chrome Developer Tools script editor. However there are a number of limitations with this approach, first is that the editor doesn't seem to always work with de-minified files, and when the JS file is 35K lines long, this is a problem. Another issue is that all the initialization that is done during load time, uses the original "unpatched" functions, hence this is not ideal. I would like to replace the remote javascript.js file with my own local copy,

Replace text with link to that text?

拥有回忆 提交于 2019-11-29 18:50:29
This is a follow up of my earlier question. I'm trying to use Greasemonkey to change the text in a <td> to a link that contains that text. So the page contains <td class="something"><div style="width: 200px;"> randomtext </div></td> And I want to change it using Greasemonkey to: <td class="something"><div style="width: 200px;"> <a href="www.somewhere.com/q?=randomtext">randomtext</a> </div></td> So far, I've cobbled together this little bit of code, but I'm sure it's the wrong approach as I'm not getting anywhere: // ==UserScript== // @require http://ajax.googleapis.com/ajax/libs/jquery/1.3.2

How do I close a firefox tab from a greasemonkey script?

萝らか妹 提交于 2019-11-29 17:21:47
问题 I have a greasemonkey user script with this single line of code... window.close(); but firefox does not allow a user script to close a window (as reported by an error message in the error console) Is there a work around to this problem? 回答1: You need to change configuration settings of Firefox (about:config) to allow this. Steps: Go to address bar and type about:config Go to parameter dom.allow_scripts_to_close_windows Set its value as true Now your script can close the TAB with 'window.close

How to make a script redirect only once every time an appropriate page loads?

岁酱吖の 提交于 2019-11-29 16:50:44
I'm writing a Tampermonkey script that I want to use to redirect from youtube.com/* to a YouTube channel address. window.addEventListener ("load", LocalMain, false); function LocalMain () { location.replace("https://www.youtube.com/channel/*"); } When the script is running it redirects to the channel URL but then keeps running and continuously redirects . You need to check if the current pathname includes channel before reassigning a new href function LocalMain () { if(!location.pathname.includes('/channel/')) { location.replace("https://www.youtube.com/channel/*"); } } Also note you don't

execute function only once

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 16:22:38
I'm writing a greasemonkey script and want to call the start function only once after the page loads - it's for facebook. First I started with following code: function start(){ alert("hello"); } start(); The start() function was executed more then once. So I changed the code to following: jQuery.noConflict(); window.stoop = 0; jQuery(document).ready(function(){ if(window.stoop == 0){ start(); } window.stoop = 55; //or window.stoop++; }); function start(){ alert("hello"); } The problem is that the window.stoop value won't change. I tried with var stoop = 0; stoop++; and var obj = {}; obj.stoop

tampermonkey script stops working if I change the page

巧了我就是萌 提交于 2019-11-29 16:14:50
I am using Tampermonkey to save time on frequent tasks. The goal is to get content of an element on www.example1.com, navigate to another page, and do stuff there. The starting page is www.example1.com as seen from match . This is the code I am using: //@match http://example1.com var item = document.getElementById("myId").textContent; window.open("http://example2.com","_self"); setTimeOut(function( //perform clicks on this page ){},3000); None of the code after changing URLs ever gets executed. Why, and what is the workaround? wOxxOm Allow the userscript on both urls and use GM_setValue / GM

Rewrite parts of links using Greasemonkey and FireFox

一笑奈何 提交于 2019-11-29 16:12:54
A friend of mine uploaded about 20 or so galleries of nature shots she's done over the past year or so onto webshots.com, however, I just purchased a paid Flickr account for her as a birthday gift, and I want to download all of her photos from webshots and have them ready for her to upload to Flickr once she gets the email about her account upgrade (she's out of the country - no internet access.) I don't have access to her webshots account, so I've resorted to Greasemonkey and DownThemAll to start saving her images into folders on my desktop. I'm somewhat new to javascript, and all the "user

Matching multiline Patterns

主宰稳场 提交于 2019-11-29 15:55:49
I want to use greasemonkey to scrape wiki data from Last.fm (this is not possible with their REST api). I can grab the page fine with GM_xmlhttpRequest(), and it is returning properly. I do not want to use a DOM processor to process the whole page, since I only want a small chunk, so I'm using regular expressions. The wiki data is in the page like: <div id="wiki"> description description ... </div> So I wrote: /\<div id="wiki"\>(.+)\<\/div\>/m.exec(data)[1]; When I test this in error console (where the multiple lines are flattened into a single line, it works, but on the page it fails and says