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.

58 questions
2
votes
1 answer

GM_xmlhttpRequest inside WHILE loop

I have a fairly simple task to replace specif texts on a page. Say, there are 10 DIVs, each of which containing a specific information. I want to check this information against a database, and replace the text with a result from the database. I…
1
vote
1 answer

How to call GM_xmlhttpRequest within a webpage?

I need to call a cross domain GM_xmlhttpRequest which would be triggered by an event in the webpage. How do I access the functions within the greasemonkey sandbox, from the webpage?
1
vote
1 answer

Where I can find GM_xmlhttpRequest xhr console logs

I have a little userscript running on Tampermonkey in Firefox (chrome has the same behavior) The xhr logs of these requests doesn't appear in the console or network analysis. Because it is a cors request from https to a http service, we have to use…
capoaira
  • 89
  • 1
  • 1
  • 7
1
vote
0 answers

Webscraping more than one result at a time

What I'm trying to do: I have an array with the words "one, two, three" in it, and I want to use it to search up 3 results on google, and return the results all at once. So, search up the word "one", search up the word "two", search up the word…
frosty
  • 2,559
  • 8
  • 37
  • 73
1
vote
1 answer

Is it possible to use GM_xmlhttpRequest to my data form using greasemonkey/tampermonkey?

I am currently working on GM_getvalue but it only saves data on the local storage. I wanted to save the inputted values to my server where send.php is located. This is my code: var $ = unsafeWindow.jQuery; $(document).ready(function() { …
1
vote
1 answer

Difference between curl request and Grease/TamperMonkey GM_xmlHttpRequest

I am trying to inject buttons in a website client-sided for easily sending URLs to my pyload instance. I already did a similar thing to create packages in a local jDownloader instance, so i am not too far off here. I already managed to successfully…
1
vote
0 answers

Is it possible to inspect `GM_xmlhttpRequest`s in the Developer Tools network tab?

I found out that you can perform a CORS request within a Tampermonkey script using GM_xmlhttpRequest(). Unfortunately, they don't appear in the Chrome devtools network tab. I know GM_ functions are running in their own scope somewhere within the…
1
vote
1 answer

Is it possible to execute gm_xmlhttprequest asynchronously?

I've tried putting gm_xmlhttprequest inside a while loop but the code executes synchronously. Is it possible to make it execute asynchronously, one at a time?
frosty
  • 2,559
  • 8
  • 37
  • 73
1
vote
2 answers

Promise not returning value of request

I have this promise: function getAPI(token) { return new Promise((resolve, reject) => { console.log("Request API"); GM_xmlhttpRequest({ method: "GET", url: "URL"+token, onload: function(response) { …
1
vote
0 answers

Upload image to API with GM_xmlhttprequest

For my userscript I'm trying to upload an image to http://www.noelshack.com/api.php as a POST request, using the function GM_xmlhttprequest var file = document.getElementById("MyFileInput").files[0]; GM_xmlhttpRequest({ method: "POST", url:…
1
vote
1 answer

How can Greasemonkey transfer data securely?

I want to collect some data inside a user-area of a particular page and send this data to my web server. As this data holds private financial information, the transfer should be secured. How can I send the data securely using Greasemonkey or…
1
vote
0 answers

Synchronous GM_xmlhttpRequest in loop returns result only on the next iteration

I'm running GM_xmlhttpRequest in a loop like this: for (var i = 0; i < entries.length; i++) { var entryName = entries[i]; var requestResult = ''; GM_xmlhttpRequest({ method: 'GET', url:…
ttaaoossuuuu
  • 7,786
  • 3
  • 28
  • 58
1
vote
1 answer

Userscript AJAX request gives JSON-RPC error -32700

This is extremely similar to issues, EG: Request to Random.org API with ZendFramework2. However, I think my problem lies somewhere in my data request. GM_xmlhttpRequest({ method: "POST", url: "https://api.random.org/json-rpc/1/invoke", …
Baskervor
  • 13
  • 1
  • 5
1
vote
1 answer

GM_xmlhttpRequest breaks script

I'm writing a Greasemonkey script that will run when the user visits a page, collect some information on the page, then send that info to another location for logging. However whenever the script hits the call to GM_xmlhttpRequest it just halts. For…
timh
  • 35
  • 1
  • 7
1
vote
0 answers

'@grant GM_xmlhttpRequest' causing scripts not to run [correctly]

I suspect that I am missing something, but I have looked high and low for solutions or alternatives with no luck... I have a Greasemonkey script (I don't want to copy-paste the whole thing here) that won't run when I add the line // @grant…
mabs
  • 11
  • 2