F
F
Fizerolli2021-11-27 16:03:07
JavaScript
Fizerolli, 2021-11-27 16:03:07

How to read local files in the context of a browser extension?

I am writing a browser extension. To work, you need to store somewhere and somehow read a fairly large (up to 50 megabytes) array BigUint64Array. The most logical option for me is to store in a file and read it at startup. But how to implement this without user intervention (input)? I suppose if you somehow embed it in the code, then the page loading speed will significantly decrease, and if you download from the server, then people in incognito mode will have to download conditional 50 megabytes after each browser launch ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GrayHorse, 2021-11-27
@Fizerolli

Add "unlimitedStorage"to manifest.json
And store it in browser.storage.localor in IndexedDB.
Bonus:
chrome.storage.local.get(console.log);

A
Alexander, 2021-11-27
@Aleksandr-JS-Developer

As mentioned above, the extension has a store. The client does not even need to know about it)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question