chibat / chrome-extension-typescript-starter

Chrome Extension TypeScript Starter
MIT License
2.48k stars 417 forks source link

Fetch event for loading external scripts fails #55

Closed paularah closed 1 year ago

paularah commented 1 year ago

I am porting a vanilla extension, and the Fetch event for loading scripts fails with the error The FetchEvent for "chrome-extension://*****me.js" resulted in a network error response: the promise was rejected.

Steps to reproduce.

  let s = document.createElement('script');

  s.src = chrome.runtime.getURL("me.js")
  s.onload = function () {
    //@ts-ignore
    this.remove();
  };

  (document.head || document.documentElement).appendChild(s);
paularah commented 1 year ago

My bad, I used the wrong qualified URL in the manifest file, so I'm closing this.