Questions tagged [gm-xmlhttprequest]

GM_xmlhttpRequest is a method available to GreaseMonkey scripts. It can be used to fetch cross-site HTTP requests.

GM_xmlhttpRequest is a method available to Greasemonkey scripts. The function does not suffer from the same-origin policy.

59 questions
14
votes
3 answers

ReferenceError: GM_xmlhttpRequest is not defined

I get a ReferenceError in the following userscript code: // ==UserScript== // @name ... // @namespace ... // @description ... // @include ... // @grant GM_xmlhttpRequest // ==/UserScript== console.log(GM_info); try { …
Kendall Frey
  • 39,334
  • 18
  • 104
  • 142
6
votes
1 answer

Use GM_xmlhttpRequest to POST data on Chrome?

I'm writing a user script to take an image from a page, and upload it to a server. The script works fine in FF (Greasemonkey and Scriptish), but when I use Chrome (using Tampermonkey or Ninjakit), it does not send the data, it sends the string *…
4
votes
3 answers

How to make synchronous AJAX calls in greasemonkey?

I have a list of URLs and need to load each page, one after another. This is my main function that i have in my Mind. mainFunction() { loop { // Loop through URL list oPage = func1(URL); //Get page contents aResult = func2(oPage); //Analyse the…
user1651105
  • 1,629
  • 4
  • 24
  • 44
4
votes
1 answer

What HTTP origin does GM_xmlhttpRequest send?

I want my app with a REST API to be accessible in different flavors: From the same domain (use normal AJAX request here) From another domain via script attached by site owner (CORS) From another domain via userscript (GM_xmlhttpRequest (?)) I want…
4
votes
1 answer

How to fix __exposedProps__ error on Greasemonkey (GM_xmlhttpRequest)?

I have written my first script for Greasemonkey, it is working great, except that it is returning exposedProps error in each page it is working on. I already fixed all other errors but this one is still there and based on some articles on web (like…
Mona
  • 928
  • 3
  • 13
  • 18
3
votes
1 answer

Synchronous GM_xmlhttpRequest acting asynchronously?

I'm trying to get a GM_xmlhttpRequest call to behave synchronously, but I can't get it to work like I expect: function myFunction (arg) { var a; GM_xmlhttpRequest ( { method: "GET", url: …
3
votes
1 answer

Using GM xmlhttpRequest instead of an iframe to display pertinent info from an external page

I have loaded an https page on Amazon.co.uk and I wish to display use 'GM xmlhttpRequest' to request the price of an item on a linked page. What I’ve been doing so far I tried to use an iFrame to display the window: var prodLinks =…
3
votes
1 answer

Greasemonkey AJAX post does not appear to work, even with @grant specified

My script does not work. The AJAX call is not happening. Why? // ==UserScript== // @name prova // @namespace http://blogpagliaccio.wordpress.com/ // @description prova // @include http://* // @version 1 // @grant …
2
votes
1 answer

GM_xmlhttpRequest responseText empty in Firefox but perfect in Chrome

I'm trying to do a userscript for Chrome and Greasemonkey in Firefox. I'm using the GM_xmlhttpRequest since it supposed to work in both platforms. The request code seems to work in both browsers, but in Firefox the responseText is empty in contrast…
2
votes
1 answer

Is there a way to pass a value TO GM_xmlhttprequest?

As indicated here: How can I return a value from GM_xmlhttprequest? 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…
GeoffreyF67
  • 10,331
  • 11
  • 39
  • 56
2
votes
1 answer

How to obtain a cookie from a remote domain using Greasemonkey?

I'm writing a Greasemonkey (v2.3) script that basically screen-scrapes the contents served by lema.rae.es/drae/srv/search, for lack of an API of any sort. The thing is, I want to query that URL from Google Translate, a different domain. For that,…
user4256966
2
votes
1 answer

How to get a serialized array from a client form to a server using the GM_xmlhttpRequest

I used JQuery.serializeArray() on a form to create an array of objects on a GreaseMonkey application: [ { name: a value: 1 }, { name: b value: 2 }, { name: c value: 3 }, { name: d value: 4 }, { …
dkinzer
  • 28,835
  • 12
  • 63
  • 79
2
votes
1 answer

Tampermonkey's GM_xmlhttpRequest not implementing 'context' property?

I have written a UserScript for Greasemonkey (Firefox) and am testing it for compatibility with Chrome's Tampermonkey, and getting errors in the developer console: Uncaught TypeError: Cannot read property 'profile_url' of undefined Uncaught…
2
votes
1 answer

Greasemonkey AJAX return's abort() is not a function?

Basically, I try to send a request via the GM_xmlhttpRequest() Greasemonkey API and abort it. Here is a demo script: // ==UserScript== // @name example // @namespace example795cb636-1f35 // @include …
CronosS
  • 2,964
  • 2
  • 19
  • 27
2
votes
1 answer

GM_xmlhttpRequest does not work when called from inside $(document).ready()?

This is my GM_xmlhttpRequest script: // ==UserScript== // @name test // @namespace test // @include http://stackoverflow.com/* // @version 1 // ==/UserScript== GM_xmlhttpRequest({ method: "GET", url: "http://example.com", …
Yeti
  • 5,067
  • 9
  • 42
  • 68
1
2 3 4