Closed septies434r closed 3 years ago
Btw, maybe it'd better use the user
field in docs instead of username
for better compatibility with other script managers (e.g., GM and VM). Anyway, TM was supporting the user
field too.
Btw, maybe it'd better use the
user
field in docs instead ofusername
for better compatibility with other script managers (e.g., GM and VM). Anyway, TM was supporting theuser
field too.
Yes, good point! I was actually using user
in a number of scripts when this issue started. I ended up switching to username
while debugging this issue as the Tampermonky documentation for GM_xmlhttpRequest only mentions username
and not user
and I wanted to test if the support for user
had been deprecated.
Until recently this was working fine
Will be fixed at the next beta release.
Btw, maybe it'd better use the user field in docs
I fixed the documentation. Thanks.
Will be fixed at the next beta release.
I fixed the documentation. Thanks.
Wow, that is some fast work! Impressive.
Hello,
Same here, since I updated chrome it doesn't longer work.
GM.xmlHttpRequest({
method: "GET",
url: "/api/28/api_global_rankings/view/0/1",
headers: {
"User-Agent": "Chrome/83.0.4103.116", // If not specified, navigator.userAgent will be used.
"Accept": "text/xml" // If not specified, browser defaults will be used.
},
onload: function(response) {
var responseXML = null;
// Inject responseXML into existing Object (only appropriate for XML content).
if (!response.responseXML) {
responseXML = new DOMParser()
.parseFromString(response.responseText, "text/xml");
}
var data = JSON.parse(response.responseText);
Before it used to work and now it doesn't, is it a problem from my code or from tampermonkey ?
@KaiDrolop
Sever returns 401 and examination of the request shows no "Authorization" line in the request headers.
Should be fixed at latest BETA version 4.13.6136
Expected Behavior
GM_xmlhttpRequest to support basic auth user/password or username/password arguments. Until recently this was working fine but seems to have been broken by a recent Tampermonky or Chrome update.
Actual Behavior
Sever returns 401 and examination of the request shows no "Authorization" line in the request headers.
Workaround
Manually adding the "Authorization" line to the request headers works as expected.
Specifications
Script
Visit tristanhammat.com.au with this userscript enabled and it will test a basic auth GM_xmlhttpRequest and print the result in the browser console and also in the console embedded in the webpage itself. If you would like to test the workaround uncomment the "headers" line.