My Request looks as follows:(obviously with a different url, which is different from the visited page)
var url = "https://example.com/example.json"
var request = new XMLHttpRequest()
request.onreadystatechange = function () {
if (this.readyState == 4 || this.status == 200) {
console.log(this.readyState, this.status)
var arr = JSON.parse(this.response)
// Do stuff with the response...
}
};
request.open("GET", url)
request.send()
In Chrome it always works. In Firefox it works when i execute it in the popup.js of the Addon (included in the extension popup.html, but it doesnt work in the content script, what? :o
From the Console Log im getting Status 0 when its executed from the content script.
Is there any small workaround to make it work? I mean isnt this just very basic stuff...? I also tried Javascript fetch, but there i have the exact same Problem.... :/