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

98
Views
Javascript fetch stopped working for local files

I have a tiny HTML/CSS/JS app I use to read and play certain types of files. I have no need for it to be on a server.

As of yesterday, it "worked." Suddenly, today I'm getting an error about using fetch with local files. I did make some settings changes on my Windows 10 laptop.

abcjs-init.js:15 Fetch API cannot load file:///E:/OneDrive/Documents/ABCJS-Minimal-Editor-Notation-Player/tunes/tune_list.txt. URL scheme "file" is not supported.

This is my code:

fetch(tunes_list_path,  {mode: 'no-cors'})
    .then(response =>
    {
        console.log("response:", response);
        return response
    })
    .then(data => 
    {
        console.log("data:", data)
        return data.text()
    })
    .then(Normal =>
    {
        console.log("got tunelist");
        console.log("tune_list");
        
        let  tune_list = Normal.split("\n").sort();
        addTunesToSelector(tune_list);
    })
    .catch(err =>
    {
        console.log('Fetch problem show: ' + err.message);
    });

Further up is: let tunes_list_path = "tunes/tune_list.txt";.

The index.html loads fine. I can also view the file in the error directly with its URL. So it is visible to the browser.

Do I need to enable something in my browser? Add something to the fetch call?

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

0

Aha! I had changed a setting in Firefox that allowed COORS with local files: privacy.file_unique_origin.

I apparently erased that setting during my OS maintenance.

This solution is only for FF. There may be an equivalent setting for Chromium-based browsers.

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!