0

I wanted to know if there's a way to load a JS file, located on my computer, on my browser.

I know it's possible with Firefox with Scratchpad, but could it be with Chrome or whatever else?

Bharata
  • 13,509
  • 6
  • 36
  • 50
Bablup
  • 51
  • 1
  • 3

1 Answers1

0

Yes, it is possible with Chrome/Chromium. You can store the file at LocalFileSystem using webkitRequestFileSystem and get a reference the file using FileEntry.toURL() which returns a filesystem: protocol URL.

Alternatively, use <input type="file"> to upload the file object or folder and URL.createObjectURL() to reference the file as a Blob URL.

guest271314
  • 1
  • 15
  • 104
  • 177