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

callback Optional

function. If provided, the function will be passed a DirectoryEntry object. 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.

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
getPackageDirectoryEntry

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

Examples

js
browser.runtime.getPackageDirectoryEntry((directoryEntry) => {
  console.log(directoryEntry);
});

Note: This API is based on Chromium's chrome.runtime API. This documentation is derived from runtime.json in the Chromium code.