sajid
sajid

Reputation: 883

How to access the manifest.json file of a Firefox extension?

I am making a short research about Chrome and Firefox extensions. I can access the manifest.json file of a Chrome extension installed on my Chrome browser with this URL chrome-extension://<extension_id>/manifest.json. Is there a Firefox equivalent URL to see the manifest.json of a Firefox extension? N.B: I have already tried moz-extension:// prefix. But it does not work.

Upvotes: 3

Views: 5223

Answers (2)

NNL993
NNL993

Reputation: 472

There is an easier way. Go to about:debugging, and press button This Firefox, and look up for your extension in Extensions tab, then find this text below the extension's name – Manifest URL, then open the link that will be around it (It should start with moz-extension://).

Upvotes: 8

Makyen
Makyen

Reputation: 33296

The URLs used for files inside WebExtensions add-ons are in the format:

moz-extension://<extension UUID>/<pathToFileInExtension>

If you are in code within the extension, you can obtain the URL to any file in your extension with chrome.extension.getURL(). This will effectively give you the UUID for your extension.

If you are wanting to access a file through typing it into the URL bar of the Firefox Browser UI, then you will need to obtain the UUID for the extension you desire. For WebExtensions, the mapping from extension ID to UUID is available from about:config in extensions.webextensions.uuids. The value for that key is a JSON formatted Object with keys that are the WebExtension IDs and the value for each key is that WebExtensions' UUID.

If you are wanting to generally access files within a particular extension, you may be better off finding the extensions packed archive (usually [extensionID].xpi) which will, normally, be located in your [profileDirectory]/extensions. You will then need to unpack the archive (a normal .zip archive with the file extension changed) to access the files. Doing this may be easier than trying to crawl through the files by entering their URLs one-by-one in the URL bar.

Upvotes: 3

Related Questions