tarabyte
tarabyte

Reputation: 19172

How to read file released with chrome app into blob?

I have a small file released with my chrome app that I'd like to read into memory. Everything I've found so far seems to be related to allowing a user to save to their filesystem or choose an file to upload from their filesystem. How can I access this small, internal-to-the-app file that is located at an arbitrary path in my app, e.g.:

app/resources/myfiles/myfile.txt

Upvotes: 0

Views: 166

Answers (1)

Marc Rochkind
Marc Rochkind

Reputation: 3740

Use chrome.runtime.getPackageDirectoryEntry, as explained by one of the answers to this question: How to access internal resources from background.js.

Upvotes: 1

Related Questions