0

I want to read the data from a file that is distributed with my CRX (it's in a subfolder myfiles) into a javascript variable. (It is not on the filesystem. It's inside the crx)

I understand I can use XMLHttpRequest, but what would the url be? Would it just be a relative one? or a file:///WHAT_GOES_HERE/myfile.txt? Since this is a packaged app, what would go after the "file:///"?

I don't want to use chrome.runtime.getPackageDirectoryEntry because that requires Chrome 29 or later and some of my users might not have that version

How would I do this?

This is a chrome packaged app, not extension

Don Rhummy
  • 24,730
  • 42
  • 175
  • 330

1 Answers1

1

To get the URL you should use chrome.runtime.getURL.

rsanchez
  • 14,467
  • 1
  • 35
  • 46