MDN self-hosted library · e01.org

runtime.getPackageDirectoryEntry()

Gets a DirectoryEntry object representing the package directory.

Open notebook · 1 cells webextension-api-function upstream source

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

browser.runtime.getPackageDirectoryEntry(
  callback              // optional callback function
)

Parameters

  • callback
  • : 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.

Examples

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.