In a Google Chrome application is it possible to access bundled data files from within the background.js script?
background.js
E.g. if I had a file called data.
data.
Since getPackageDirectoryEntry is not supported by firefox, it is not recommended. Now there is a simpler way.
async function loadData(resourcePath) { var url = chrome.extension.getURL(resourcePath); return (await fetch(url)).text(); }