0

My extension works in Chrome, Firefox, and Opera. I wanted to support edge too. However I cannot do a simple thing, I cannot fetch/XHR my own files! I even added <all_urls> to my permissions array in manifest.json, however I keep getting TypeMismatchError and in details it says "Permission Denied". Here is a screenshot:

devtools screenshot

Does anyone know if it is possible to fetch your own files in Edge? I need to specifically fetch the messages.json files in my /_locales/* folders.

ulidtko
  • 14,740
  • 10
  • 56
  • 88
Noitidart
  • 35,443
  • 37
  • 154
  • 323

1 Answers1

2

This is a known issue which has been reported here https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8546263/, you can use the workaround mentioned in the link or use XMLHttpRequest instead of fetch.

const xhr = new XMLHttpRequest();
xhr.onload = () => {
    console.log(xhr.responseText);
};
const url = chrome.runtime.getURL('test/test.js');
xhr.open("GET", url);
xhr.send();
Haibara Ai
  • 10,703
  • 2
  • 31
  • 47
  • 1
    Oooo, thank you very much! I didn't realize it was for all resources! – Noitidart Apr 24 '17 at 21:01
  • This should also be fixed in the Creators Update! Please file a bug at http://aka.ms/edge-issues if you still see this on versions of Edge 15.15063 or higher. – scottlow Apr 27 '17 at 20:01