diff options
Diffstat (limited to 'files/he/mozilla/add-ons/webextensions/manifest.json/index.html')
-rw-r--r-- | files/he/mozilla/add-ons/webextensions/manifest.json/index.html | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/files/he/mozilla/add-ons/webextensions/manifest.json/index.html b/files/he/mozilla/add-ons/webextensions/manifest.json/index.html deleted file mode 100644 index 13e7d0f8f8..0000000000 --- a/files/he/mozilla/add-ons/webextensions/manifest.json/index.html +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: manifest.json -slug: Mozilla/Add-ons/WebExtensions/manifest.json -tags: - - Add-ons - - Extensions - - NeedsTranslation - - Overview - - TopicStub - - WebExtensions - - manifest.json -translation_of: Mozilla/Add-ons/WebExtensions/manifest.json ---- -<p>{{AddonSidebar}}</p> - -<div class="blockIndicator note"> -<p>This article describes manifest.json for web extensions. If you are looking for information about the manifest.json in PWAs, check out the <a href="/en-US/docs/Web/Manifest">Web App Manifest</a> article.</p> -</div> - -<p>The <code>manifest.json</code> file is the only file that every extension using WebExtension APIs must contain.</p> - -<p>Using <code>manifest.json</code>, you specify basic metadata about your extension such as the name and version, and can also specify aspects of your extension's functionality, such as background scripts, content scripts, and browser actions.</p> - -<p>It is a <a href="/en-US/docs/Glossary/JSON">JSON</a>-formatted file, with one exception: it is allowed to contain "<code>//</code>"-style comments.</p> - -<p><code>manifest.json</code> keys are listed below:</p> - -<div class="index">{{ListSubpages("/en-US/Add-ons/WebExtensions/manifest.json")}}</div> - -<p><code>"manifest_version"</code>, <code>"version"</code>, and <code>"name"</code> are the only mandatory keys. <code>"default_locale"</code> must be present if the "_locales" directory is present and must be absent otherwise. <code>"browser_specific_settings"</code> is not supported in Google Chrome.</p> - -<p>You can access your extension's manifest from the extension's JavaScript using the {{WebExtAPIRef("runtime.getManifest()")}} function:</p> - -<pre class="brush: js; no-line-numbers">browser.runtime.getManifest().version;</pre> - -<h2 id="Example">Example</h2> - -<p>The block below contains shows the basic syntax for some common manifest keys. Note that it is not intended to be used as a copy-paste-ready example: which keys you need will depend on the extension you are developing. For complete example extensions, see <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Examples">Example extensions</a>.</p> - -<pre class="brush: json;">{ - "browser_specific_settings": { - "gecko": { - "id": "addon@example.com", - "strict_min_version": "42.0" - } - }, - - "background": { - "scripts": ["jquery.js", "my-background.js"], - "page": "my-background.html" - }, - - "browser_action": { - "default_icon": { - "19": "button/geo-19.png", - "38": "button/geo-38.png" - }, - "default_title": "Whereami?", - "default_popup": "popup/geo.html" - }, - - "commands": { - "toggle-feature": { - "suggested_key": { - "default": "Ctrl+Shift+Y", - "linux": "Ctrl+Shift+U" - }, - "description": "Send a 'toggle-feature' event" - } - }, - - "content_security_policy": "script-src 'self' https://example.com; object-src 'self'", - - "content_scripts": [ - { - "exclude_matches": ["*://developer.mozilla.org/*"], - "matches": ["*://*.mozilla.org/*"], - "js": ["borderify.js"] - } - ], - - "default_locale": "en", - - "description": "...", - - "icons": { - "48": "icon.png", - "96": "icon@2x.png" - }, - - "manifest_version": 2, - - "name": "...", - - "page_action": { - "default_icon": { - "19": "button/geo-19.png", - "38": "button/geo-38.png" - }, - "default_title": "Whereami?", - "default_popup": "popup/geo.html" - }, - - "permissions": ["webNavigation"], - - "version": "0.1", - - "user_scripts": { - "api_script": "apiscript.js", - }, - - "web_accessible_resources": ["images/my-image.png"] -}</pre> - -<h2 id="Browser_compatibility">Browser compatibility</h2> - -<p>For a full overview of all manifest keys and their sub-keys, <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_compatibility_for_manifest.json">see the full <code>manifest.json</code> browser compatibility table</a>.</p> - - - -<p>{{Compat("webextensions.manifest")}}</p> - -<h2 id="See_also">See also</h2> - -<p>{{WebExtAPIRef("permissions")}} JavaScript API</p> |