Javascript Fetch API not loading in Firefox Extension. I am quiet new here, but how do I solve the problem or what alternatives do I have to get a file from the server in Browser Extensions?
test.html
<!DOCTYPE html>
<html>
<body>
<p id="demo">Fetch a file to change this text.</p>
<script>
fetch ('http://localhost/test/test.txt')
.then(x => x.text())
.then(y => document.getElementById("demo").innerHTML = y);
</script>
</body>
</html>
manifest.json
{
"manifest_version": 2,
"name": "test",
"version": "1",
"description": "test",
"permissions": [
"storage",
"activeTab",
"tabs",
"http://*/*",
"https://*/*"
],
"browser_action": {
"default_title": "test",
"default_popup": "popup/test.html"
}
}