greasemonkey

Greasemonkey, Chrome and unsafeWindow.foo()

末鹿安然 提交于 2019-12-30 03:28:06
问题 I have the following anchor tag, which contains dynamically-generated arguments arg1,...,arg5 to the JavaScript function foo() , which runs on the web site-side. There are several of these anchor tags throughout the page in question, with unique id values and argN values: <a href="#" id="foo1234567890" onclick="javascript:foo(arg1,arg2,arg3,arg4,arg5);return false;" target="_self" title="foobarbaz"> blah </a> I would like to programmatically fire the foo() function by looping through all hits

jQuery.getJSON inside a greasemonkey user script

你。 提交于 2019-12-28 11:50:49
问题 I am attempting to write a user script that makes a cross domain AJAX request. I have included jQuery inside my script using @require and everything seems to be working fine up until the point where I try to run jQuery.getJSON. The API I am accessing supports jsonp, however I keep getting an error stating jsonp123456789 is not defined. From what I have been able to gather this is due to jQuery writing the jsonp response directly into the head of the page, which then becomes sandboxed. Once

how to use the google maps api with greasemonkey to read a table of addresses and trace the route?

南楼画角 提交于 2019-12-28 06:16:02
问题 There is a website which holds the buses routes for my city (Porto Alegre - Brazil) in a table. ex: EPTC Using Greasemonkey to load de Google Maps API, id like to show a fixed map at the top right corner of the screeen. The script must read the street names from the table, strip de extra spaces (there are a lot of them), and draw the route in the right order. 回答1: Here is the Greasemonkey compatible script to accomplish the task: http://userscripts.org/scripts/show/116339 Key points: 1- find

how to use the google maps api with greasemonkey to read a table of addresses and trace the route?

删除回忆录丶 提交于 2019-12-28 06:15:10
问题 There is a website which holds the buses routes for my city (Porto Alegre - Brazil) in a table. ex: EPTC Using Greasemonkey to load de Google Maps API, id like to show a fixed map at the top right corner of the screeen. The script must read the street names from the table, strip de extra spaces (there are a lot of them), and draw the route in the right order. 回答1: Here is the Greasemonkey compatible script to accomplish the task: http://userscripts.org/scripts/show/116339 Key points: 1- find

Apply a Greasemonkey/Tampermonkey/userscript to an iframe?

Deadly 提交于 2019-12-28 02:08:47
问题 The title is pretty much the question: Is it possible to add a Greasemonkey script to an iframed website? If so, how? Thank you. 回答1: In Greasemonkey (And Tampermonkey and most userscript engines) a script will fire on an iframe automatically if it meets the @include, @exclude, and/or @match directives. And, a popular question is how to stop Greasemonkey from firing on iframes. So, if your script had a match like: @match https://fiddle.jshell.net/* It would fire on jsFiddle "output" pages

Why is window (and unsafeWindow) not the same from a userscript as from a <script> tag?

主宰稳场 提交于 2019-12-27 11:04:38
问题 I was facing an issue while developing this small userscript. When I wanted to block every XMLHttpRequest from the running website with my script, nothing was happening (at least with Chrome): function main() { // Override XHR.open with a custom function window.XMLHttpRequest.prototype.open = function() { // Nothing... so it's supposed to block every xhr.open() call } } main(); Same thing when replacing window by unsafeWindow . However, when I used this little trick, everything worked like a

GM_getValue undefined error

∥☆過路亽.° 提交于 2019-12-25 16:51:44
问题 In my greasemonkey script I want to check if the GM Value : Username and Password isset but when i try the following code it gives me back the error : TypeError: GM_getValue(...) is undefined ...f (GM_getValue ("username").length == 0 + GM_getValue ("password").length == 0 ) Code: if (GM_getValue ("username").length == 0 + GM_getValue ("password").length == 0 ){ var username = $('input[name=username]'); var password = $('input[name=password]'); //Username en Password in Firefox zetten met GM

Using grease/tampermonkey, how can I have the currently viewed definition at Dictionary.com open at Thesaurus.com?

依然范特西╮ 提交于 2019-12-25 16:50:42
问题 Using Greasemonkey or Tampermonkey, how can I have the currently viewed definition at Dictionary.com open at Thesaurus.com (and vice versa) when the links circled in red are clicked. I see that I can use window.location.pathname to retrieve "/browse/test" or whatever word is being searched, which I can then put on the opposite link's hostname. The HTML of the Thesaurus.com link: <a href="http://www.thesaurus.com/" data-linkid="qxnxzj">Thesaurus.com</a> The HTML of the Dictionary.com link: <a

Use Greasemonkey to change row format based on one cell's contents?

假装没事ソ 提交于 2019-12-25 09:35:25
问题 I have a table full of cells that look like this: <tr class="dataRow odd"> <td class="actionColumn"> someAction </td> <th class=" dataCell booleanColumn" scope="row"> <img class="checkImg" width="21" height="16" title="Not Checked" alt="Not Checked" src="/img/checkbox_unchecked.gif"> </img> </th> <td class=" dataCell "> SomeData </td> </tr> The middle <th> cell will have an image with either title="Not Checked" or title="Checked" . I'd like to apply some formatting to the entire row if title=

Listening to an event from my greasemonkey script

吃可爱长大的小学妹 提交于 2019-12-25 09:11:43
问题 I'm trying to figure out how to listen to an event emitter from my greasemonkey script, but I keep getting access violation errors ( Permission denied to access object ). Page The page contains a simple event emitter: var emitter = function(){ this.events = {}; } emitter.prototype.on = function(eventName, closure){ this.events[eventName] = this.events[eventName] || []; this.events[eventName].push(closure); }; emitter.prototype.emit = function(eventName, data){ if(this.events[eventName]){ this