greasemonkey

How to automatically set the size of a drop-down list?

大兔子大兔子 提交于 2019-12-11 01:48:27
问题 I'm trying to write a script in Greasemonkey that will automatically set the size of Drop-down lists (there can be more than one...) on the number of selection options, but with my limited JavaScript knowledge I don't really know how to do this. Example of subject: <select name="z_pos_id"> <option value="2463">Option A</option> <option value="2609">Option B</option> <option value="3013">Option C</option> </select> <select name="z_pos_id"> <option value="140">Option AA</option> <option value=

Storing or loggin data with greasemonkey which can be processed later

江枫思渺然 提交于 2019-12-11 00:26:18
问题 I'm curently busy on a site for which i want to write a greasemonkey script that logs all the data, or at least certain postions of it, and saves in an file that will be interperatable fo ms excell. Is that possible? say for example i take this snippet of data: {"d":[["","","y","ZAR","1","49517","6458, 8270, 8270, 8270, 7635",null,"1.40","6458","0:13:30","","12","","C","30",null],["y","-00:00","y","ZAR","2","49593","6458, 6458, 6458, 6458, 6458",null,"2.92","6458","0:13:37","","12","","L","12

Greasemonkey button click

假如想象 提交于 2019-12-10 23:11:36
问题 Can anyone please help me with clicking this button using greasemonkey? http://mibpaste.com/te6fRR (Full Source) 回答1: var evt = document.createEvent ("HTMLEvents"); evt.initEvent ("click", true, true); document.getElementById('fight_btn').dispatchEvent (evt); See: http://wiki.greasespot.net/Generate_Click_Events 回答2: Since createEvent and initEvent are now deprecated , the following uses the new MouseEvent() constructor instead: document.getElementById("fight_btn").dispatchEvent(new

Greasemonkey to Modify Text based on other parts of the webpage?

纵饮孤独 提交于 2019-12-10 22:26:24
问题 The Backstory: I am looking to improve a Fantasy Football webpage by adding stats of the players in real-time. Let's assume we are using this page as a reference. For each player, it lists the position they play (i.e. QB, WR, etc) and also the team they play against. My Current Code: @BrockAdams answered my question yesterday and was able to assemble a table that contained the team name, position, and the rank. Here is a sample of the table: What I am looking to accomplish is lookup the rank

Greasemonkey script to find rows with certain conditions

落花浮王杯 提交于 2019-12-10 21:53:25
问题 I tried some different ways do find rows in a table where a columns contain a particular link. My goal: replace an icon when a link to xyz is in this same row as the image. This is my snippet so far: var rows = document.getElementsByTagName("tr"); for(var i = rows.length - 1; i >= 0; i--) { var links = rows[i].getElementsByTagName("a"); for(var k = links.length - k; k >= 0; k--) { if (links[k].href =="http://www.XXXX.net/forum/index.php?showforum=121"){ var images = rows[i]

getting BR-separated text via DOM in JS/JQuery?

和自甴很熟 提交于 2019-12-10 20:49:01
问题 I am writing a greasemonkey script that is parsing a page with the following general structure: <table> <tr><td><center> <b><a href="show.php?who=IDNumber">(Account Name)</a></b> (#IDNumber) <br> (Rank) <br> (Title) <p> <b>Statistics:</b> <br> <table> <tr><td>blah blah etc. </td></tr></table></center></table> I'm specifically trying to grab the (Title) part out of that. As you can see, however, it's set off only by a <BR> tag, has no ID of its own, is just part of the text of a <CENTER> tag,

Greasemonkey + jQuery: using GM_setValue() within an event callback

*爱你&永不变心* 提交于 2019-12-10 19:47:30
问题 I'm trying to set data in long-term storage in a GreaseMonkey script, except that GM_setValue() seems to fail silently: $("a#linkid").click(function() { GM_setValue("foo", 123); // doesn't work, but does not generate error }); GM_setValue("bar", 123); // works properly, value is set 回答1: I think this is a specific Greasemonkey security issue. Please see 0.7.20080121.0 compatibility. GM does not allow user pages to call GreaseMonkey APIs, and that's what you're doing there (you're registering

Fetching xml with GM_xmlhttpRequest

三世轮回 提交于 2019-12-10 18:59:40
问题 I'm trying to retrieve a page with greasemonkey and then extract a link from it, inserting the link into the current page. I'm having some trouble with: GM_xmlhttpRequest({ method: "GET", url: "http://www.test.net/search.php?file=test", onload: function(data) { if (!data.responseXML) { data.responseXML = new DOMParser().parseFromString(data.responseText, "text/xml"); } alert("!"); var xmldata = data.response.xml; var tests = xmldata.getElementsByTagName('test'); alert(tests[0].innerHTML); } }

Insert Iframe Into a Div Using Javascript - for Greasemonkey

扶醉桌前 提交于 2019-12-10 17:28:36
问题 I need to insert an iframe into a div using javascript. I need this written in javascript so I can use the code in a greasemonkey script (and greasemonkey only allows for javascript). The greasemonkey script will be inserting AOL's search bar into various websites. I've included the working HTML code below so you can test it out to see what the end result is when this works. Here is exactly what I need to do, written in HTML: <div style="overflow: hidden; width: 564px; height: 43px; position:

Greasemonkey AJAX request is not sending data?

不羁的心 提交于 2019-12-10 17:28:26
问题 I am firing a GET request with Greasemonkey's GM_xmlhttpRequest() : $(".getReview").click(function(){ var videoId = $(this).parents("li").find("a").attr("href"); alert(videoId); GM_xmlhttpRequest({ method: "GET", url: "http://www.amitpatil.me/demos/ytube.php", data: "username=johndoe&password=xyz123", headers: { "User-Agent": "Mozilla/5.0", // If not specified, navigator.userAgent will be used. "Accept": "text/xml" // If not specified, browser defaults will be used. }, onload: function