Security error in firefox ext while fetching a file

While fetching a files contents with the following code in a background.js file:

function readFile(filename) {
    let response = fetch(`file:///${filename}`);

I get the following error:

Security Error: Content at moz-extension://86d386b7-2904-441f-8dbe-47f0af9b6bfb/_generated_background_page.html may not load or link to file:///C:/Users/rando/Downloads/
TypeError: NetworkError when attempting to fetch resource.

My manifest file looks like this:

  "permissions": [
  "background": {
    "scripts": [
    "persistent": true

How do I solve this error and fetch the contents of the file using the background.js file?

Source: Ask Javascript Questions