runtime.getPackageDirectoryEntry()
Gets a DirectoryEntry object representing the package directory.
This is an asynchronous function that either takes a callback or returns a promise.
Note: The promise-based API is supported in Manifest V3 and later.
Syntax
js
browser.runtime.getPackageDirectoryEntry( callback // optional callback function ) Parameters
callbackOptional-
function. If provided, the function will be passed aDirectoryEntryobject. If absent, the function returns a promise instead.
Return value
None (undefined) if a callback is provided. Otherwise, returns a Promise that will be fulfilled with a DirectoryEntry object representing the package directory.
Examples
js
browser.runtime.getPackageDirectoryEntry((directoryEntry) => { console.log(directoryEntry); }); Browser compatibility
Note: This API is based on Chromium's chrome.runtime API. This documentation is derived from runtime.json in the Chromium code.