Read .webm file from filesystem:chrome-extension://EXTENSION ID/persistent/ and create JavaScript File from it

I’m writing an Chrome Extension for screen capturing, which records video to .webm file inside filesystem:chrome-extension://EXTENSION ID/persistent/myfile.webm and later I need to upload this file through my website, so I need to have recording as a File JavaScript object which can be uploaded.

I tried using this code to fetch a file (I found it somewhere else on SO):

function urltoFile(url, filename, mimeType) {
    return (fetch(url)
        .then(function (res) {
            return res.arrayBuffer();
        .then(function (buf) {
            return new File([buf], filename, {
                type: mimeType

I call it with this code:

urltoFile("filesystem:chrome-extension://EXTENSION ID/persistent/myfile.webm","myfile.webm","video/webm").then(function (file) {
    //Here I would do something with the file

but all I get is this error:

Uncaught (in promise) TypeError: Failed to fetch

I’m wondering how can I achieve what I need?