javascript - Chome Extension, list its directory entries -
i trying develop chrome extension occurred in problem.
i need list entries of directory inside of extension itself, but, when try implement chrome.runtime.getpackagedirectoryentry(function(root) {}
console notifies me chrome.runtime.getpackagedirectoryentry not function.
function getimage(callback) { chrome.runtime.getpackagedirectoryentry(function(root) { root.getdirectory("images", {create: false}, function(localesdir) { var reader = localesdir.createreader(); // assumes there fewer 100 locales; otherwise see directoryreader docs reader.readentries(function(results) { callback(results.map(function(de){return de.name;}).sort()); }); }); }); } getimages(function(data){console.log(data);});
i post manifest.json too
{ "name": "my ext", "version":"1.1", "manifest_version":3, "content_scripts": [ { "matches": [ "*://mysite.dev:*/*" ], "css": ["content.css"], "js": ["content.js"] } ], "web_accessible_resources": ["images/*.png","images/*.gif"] }
could me?
Comments
Post a Comment