Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

538
Views
Fetch inside content script fails with chrome-extension://invalid

Inside my content script, I resolve a URL and execute a fetch on it:

let url = chrome.runtime.getURL('/hints/heart.html')

console.log("url = " + url)

fetch(url)
    .then(r => r.text())
    .then(injectedContent => {
        // do stuff with injectedContent
    });

The URL is resolved correctly. I can see that from printing it to the console. The file there also exists.

However, fetch is returning an error saying that it's trying to call the URL chrome-extension://invalid.

I already added the path the web_accessible_resource in the manifest:

"web_accessible_resources": [
    {
      "resources": [ "/hints/*" ],
      "matches": [ "https://*.myurl.com/*" ]
    }
  ]

What am I missing?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Always reload your extension from chrome://extensions/ when you modify files like background.js or the manifest.json.

You can use the normal page refresh when you only modify html files and the js files linked to them (popup.html and popup.js for example).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!