-
Notifications
You must be signed in to change notification settings - Fork 342
Closed
Milestone
Description
For onprogress events (where readyState < 4), status is set to null, even though it's available to the extension (e.g. Violentmonkey works fine).
Test script:
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include *
// @grant GM.xmlHttpRequest
// ==/UserScript==
(function() {
'use strict';
var xhr;
var loadfunc = function(resp) {
if (resp.readyState < 2)
return;
console.log(resp);
xhr.abort();
};
var obj = {
url: "https://www.google.com/"
};
if (true) {
obj.onprogress = loadfunc; // status == null
} else {
obj.onload = loadfunc; // status == 200
}
xhr = GM.xmlHttpRequest(obj);
})();This is problematic for my userscript (https://greasyfork.org/en/scripts/36662-image-max-url), as it believes status == 0/null to mean that the website was blocked via either tracking protection or that the domain/ip couldn't be resolved.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels