Closed 7nik closed 3 years ago
Nice find! 🙈
Thanks for all your bug reports.
Also,
// ==UserScript==
// @name Test GM_XHR responseType
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://github.com/*
// @grant GM_xmlhttpRequest
// @grant GM.xmlHttpRequest
// @connect httpbin.org
// ==/UserScript==
(() => {
GM.xmlHttpRequest ({
url: "https://httpbin.org/json",
responseType: 'json',
})
.then(() => GM.xmlHttpRequest ({
url: "https://httpbin.org/html",
responseType: 'document',
}))
.then(() => console.log('DONE'))
})();
these two types cause
xhr: requested responseType json differs from received
xhr: requested responseType document differs from received
on the background page where received type is an empty string.
GM_XHR in fetch mode fails when responseType explicitly set to text.
Should be fixed at 4.11.6117
xhr: requested responseType json differs from received
It's just a console message. So I'll address that later.
GM_XHR in fetch mode fails when
responseType
explicitly set totext
.Expected Behavior
Prints to the console Response object.
Actual Behavior
Prints error
{readyState: 4, responseHeaders: "", status: 408, statusText: "Cannot read property 'then' of undefined"}
Specifications
Chromium: Version 83.0.4103.97 (Official Build) Arch Linux (64-bit) TM: beta, 4.11.6116 OS: KDE Manjaro (64-bit)
Script
(Please give an example of the script if applicable.)