greasemonkey

How can I return a value from GM_xmlhttprequest?

I have this code here: var infiltrationResult; while(thisOption) { var trNode = document.createElement('tr'); var tdNode = document.createElement('td'); var hrefNode = document.createElement('a'); infPlanetID = thisOption.getAttribute('value'); var myURL = "http://www.hyperiums.com/servlet/Planetinf?securitylevel=90...

Is there a way to pass a value TO GM_xmlhttprequest?

As indicated here: http://stackoverflow.com/questions/525243/how-can-i-return-a-value-from-gmxmlhttprequest I have a script that is asynchronous. I would like to pass a value INTO this function so that when the onload function is called I can use it to display in the web page. The challenge I'm having is that this value will change e...

Javascript: loading mass amount of data in memory based on condition

I have many different regex patterns automatically loaded everytime my greasemonkey script starts. 95% of this loaded memory isn't needed at any stage, so I would like to find a way to not even put that data into memory to begin with if I know it won't be used. Take this a basic example: var patterns = [ { name : 'p1', ...

GreaseMonkey: How can I create an object of a class which defined in the remote page?

for example, in the remote webpage, there is a snippet of code like this: function foo(){ this.bar = 0; } In my greasemonkey script, I wanna create an object of this class, var _foo= unsafeWindow['foo']; new _foo(); then I got a Illegal Value error. Thanks, ...

Greasemonkey Script and Function Scope

Here is my script code: // ==UserScript== // @name test // @description test // @include http://* // @copyright Bruno Tyndall // ==/UserScript== var main = function() { var b = document.getElementsByTagName('body')[0]; var t = document.createElement('div'); t.inn...

jQuery UI Dialog Throw Errors When Invoked from Greasemonkey

I'm getting this awkward error any time I try and create a dialog from Greasemonkey... I believe it has to do with the limitations of XPCNativeWrapper https://developer.mozilla.org/en/XPCNativeWrapper#Limitations_of_XPCNativeWrapper , though I am not 100% sure. None of the core jQuery methods that I've used have caused errors (append, ...

Upload selected area as image to server

I want to create a application (Firefox extension ) which will grab a screen area and save to image and upload to server. Here is my roadmap. First I will create a greasemonkey user script which will applicable to all domain, When any page will load , It will add a small button named "screengrab + upload" . when User will click on button...

launch an app to record keep with greasemonkey

I have my greasemonkey script scanning every page i visit for a specific string. I would like to recordkeep the variations of the string in a sqlite db. I'll have another app process this db everyonce in a while. What i dont know is HOW do i store the data into the sqlite db? i was thinking i can launch an executable automatically if the...

Can a Greasemonkey script override AdBlock filters?

I have a Greasemonkey script that is trying to access an HTML element that Adblock is disabling. Is it possible to create a workaround with the Greasemonkey script to prevent conflicts with the Adblock plugin? I'm open to any ideas, however changing the script to avoid the Adblock element is not a solution at this time. Additional Info...

How to capture the Ajax event that periodically refreshes the gmail inbox

I'm trying to write a Greasemonkey script that works with Gmail. I know how to create javascript that reacts to the user clicking on the Inbox link or the the Refresh link. My problem is that Gmail periodically refreshes the inbox with new conversations and I have no way of capturing this event. Is there any way to capture periodical ...

How can I intercept XMLHttpRequests from a Greasemonkey script?

I would like to capture the contents of AJAX requests using Greasemonkey. Does anybody know how to do this? ...

Please check my Javascript Snippet. It's a greasemonkey script for FB Mobwars

Hey guys, I'm practising my Javascript programming by developing greasemonkey scripts, theoretically it would improve my javascript coding cause it's raw javascript. So now, im coding a script for Mobwars facebook. It's a game where you kill people, steal stuffs, create mobs, etc etc. To understand this better, here's the screenie of t...

inspect javascript calls for gmail's buttons

i'm working on a greasemonkey script for gmail in which it'd be very useful to know what function call is made when the "send" button is clicked. (i was unable to find this using firebug, but am relatively new to javascript debugging.) it seems that one should be able to detect this, i just don't know what tool(s) to use. thanks very mu...

Getting all nodes between the current node and another without current()?

I'm working on a Greasemonkey script which needs to operate on each node between two others. Currently, I'm getting the first node using an (increasingly-complicated) XPath expression. I have another expression to get the "between" nodes, but it contains the initial expression twice and is getting rather long. Here's an earlier versio...

how intercept xhr with greasemonkey

hi, i've tried the following code : (function(open) { XMLHttpRequest.prototype.open = function(method, url, async, user, pass) { this.addEventListener("readystatechange", function() { console.log(this.readyState); }, false); open.call(this, method, url, async, user, pass); }; })(XMLHttpRe...

How does one have Greasemonkey run before *anything* else in the page?

Is it possible to have Greasemonkey scripts run before anything else on the page? I'm aware of @run-at document-start, but this appears to run immediately after the <HTML> tag. Normally this isn't a problem, but if the page is misformatted as in the example below, there doesn't seem to be anything I can do. I'd appreciate any suggesti...

How do you organize Javascript verboseness?

Hey guys I am coding a GM script, and one thing I realised that I'm doing repeatedly is doing the same code over and over again. Specifically, the style property. function createButton() { var a = document.createElement('a'); a.href = '#'; a.innerHTML = 'Print Topic'; a.style.position = 'absolute'; a.style.right = '...

I want to attach an event to a link dynamically.. But the onclick attach didnt work.

Guys, So I'm coding a Greasemonkey script for this website.. Anyway, my problem is I can't attach the onclick event into my newly created anchor. I don't know what's wrong, maybe because I'm in Greasemonkey thats why It didn't work as expected? function createButton() { var a = document.createElement('a'); var css = document.c...

load remote url with greasemonkey and jquery

I'm trying to perform and AJAX query from within a grease monkey script, but I'm stuck with not being able to load data from a remote url. The script only seems to function if the page being viewed is the same domain as the AJAX call. Example: // ==UserScript== // @name Hello jQuery // @namespace http://www.example.com/ // ...

xpath greasemonkey

I am trying to modify gmail in a greasemonkey script. Using xpather i can get the xpath expression for the part i am trying to hide. But using following snippet i can not get a match. alert function is never called. Can anyone point me to what am i doing wrong? var allLinks, thisLink; allLinks = document.evaluate( "//html/body/div[...