diff --git a/files/en-us/mozilla/add-ons/webextensions/api/devtools/index.md b/files/en-us/mozilla/add-ons/webextensions/api/devtools/index.md index ae46997249f3015..7c503802fd1b434 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/devtools/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/devtools/index.md @@ -7,9 +7,11 @@ browser-compat: webextensions.api.devtools {{AddonSidebar}} -Enables extensions to interact with the browser's {{Glossary("Developer Tools")}}. You can use this API to create Developer Tools pages, interact with the window that is being inspected, inspect the page network usage. +Enables extensions to interact with the browser's {{Glossary("Developer Tools")}}. You use this API to create Developer Tools pages, interact with the window that is being inspected, inspect the page network usage. -To use this API you need to have the `"devtools"` [API permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#api_permissions) specified in your [manifest.json](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json) file. This permission can not be optional. +To use this API, you must specify the [`devtools_page`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/devtools_page) manifest key. The use of this manifest key triggers [an install-time permission warning about devtools](https://support.mozilla.org/en-US/kb/permission-request-messages-firefox-extensions#w_extend-developer-tools-to-access-your-data-in-open-tabs). To avoid an install-time permission warning, mark the feature as optional by listing the `"devtools"` permission in the [`optional_permissions`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions) manifest key. + +> NOTE: The "devtools" optional permission is only supported by Firefox and not Chrome ([Chromium issue 1143015](https://crbug.com/1143015)). ## Properties diff --git a/files/en-us/mozilla/add-ons/webextensions/extending_the_developer_tools/index.md b/files/en-us/mozilla/add-ons/webextensions/extending_the_developer_tools/index.md index d859a842d3ea3fc..74015f04412f649 100644 --- a/files/en-us/mozilla/add-ons/webextensions/extending_the_developer_tools/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/extending_the_developer_tools/index.md @@ -6,17 +6,17 @@ page-type: guide {{AddonSidebar}} -> **Note:** This page describes devtools APIs as they exist in Firefox 55. Although the APIs are based on the [Chrome devtools APIs](https://developer.chrome.com/docs/extensions/mv3/devtools/), there are still many features that are not yet implemented in Firefox, and therefore are not documented here. To see which features are currently missing please see [Limitations of the devtools APIs](#limitations_of_the_devtools_apis). +> **Note:** This page describes the devtools APIs in Firefox 55. Although the APIs are based on the [Chrome devtools APIs](https://developer.chrome.com/docs/extensions/mv3/devtools/), Firefox does not implement all those features; therefore, not all features are documented here. To see which features are missing, refer to [Limitations of the devtools APIs](#limitations_of_the_devtools_apis). -You can use WebExtensions APIs to extend the browser's built-in developer tools. To create a devtools extension, include the "[devtools_page](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/devtools_page)" key in [manifest.json](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json): +You can use WebExtensions APIs to extend the browser's built-in developer tools. To create a devtools extension, include the "[devtools_page](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/devtools_page)" key in your [manifest.json](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json) file: ```json "devtools_page": "devtools/devtools-page.html" ``` -The value of this key is a URL pointing to an HTML file that's been bundled with your extension. The URL should be relative to the manifest.json file itself. +The value of this key is a URL pointing to an HTML file bundled with your extension, a special extension page called the devtools page. The URL must be relative to the manifest.json file. -The HTML file defines a special page in the extension, called the devtools page. +This manifest key implicitly sets the `"devtools"` permission, which triggers [an install-time permission warning about devtools](https://support.mozilla.org/en-US/kb/permission-request-messages-firefox-extensions#w_extend-developer-tools-to-access-your-data-in-open-tabs). To avoid this warning, mark the feature as optional by listing the `"devtools"` permission in the [`optional_permissions`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions) manifest key. Setting the optional permission can be particularly helpful when introducing devtools features in an update, as it prevents the extension from being disabled (in Chrome) or blocked from updating (in Firefox). ## The devtools page diff --git a/files/en-us/mozilla/add-ons/webextensions/manifest.json/devtools_page/index.md b/files/en-us/mozilla/add-ons/webextensions/manifest.json/devtools_page/index.md index a0a6dde24378db9..a0c56b101788559 100644 --- a/files/en-us/mozilla/add-ons/webextensions/manifest.json/devtools_page/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/manifest.json/devtools_page/index.md @@ -34,6 +34,8 @@ Use this key to enable your extension to extend the browser's built-in devtools. This key is defined as a URL to an HTML file. The HTML file must be bundled with the extension, and the URL is relative to the extension's root. +The use of this manifest key triggers [an install-time permission warning about devtools](https://support.mozilla.org/en-US/kb/permission-request-messages-firefox-extensions#w_extend-developer-tools-to-access-your-data-in-open-tabs). To avoid an install-time permission warning, mark the feature as optional by listing the `"devtools"` permission in the [`optional_permissions`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions) manifest key. + See [Extending the developer tools](/en-US/docs/Mozilla/Add-ons/WebExtensions/Extending_the_developer_tools) to learn more. ## Example diff --git a/files/en-us/mozilla/add-ons/webextensions/manifest.json/optional_permissions/index.md b/files/en-us/mozilla/add-ons/webextensions/manifest.json/optional_permissions/index.md index ad78436d63ea285..e0a3ae98d791073 100644 --- a/files/en-us/mozilla/add-ons/webextensions/manifest.json/optional_permissions/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/manifest.json/optional_permissions/index.md @@ -67,6 +67,7 @@ You can include any of the following here, but not in all browsers: check the co - `contextMenus` - `cookies` - `debugger` +- `devtools` - `declarativeNetRequestFeedback` - `downloads` - `downloads.open` diff --git a/files/en-us/mozilla/add-ons/webextensions/manifest.json/permissions/index.md b/files/en-us/mozilla/add-ons/webextensions/manifest.json/permissions/index.md index 470166654ef48c3..7322a306a52c834 100644 --- a/files/en-us/mozilla/add-ons/webextensions/manifest.json/permissions/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/manifest.json/permissions/index.md @@ -97,6 +97,7 @@ These permissions are available in Manifest V2 and above unless otherwise noted: - `declarativeNetRequest` - `declarativeNetRequestFeedback` - `declarativeNetRequestWithHostAccess` +- `devtools` (This permission is granted implicitly when the [`devtools_page`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/devtools_page) manifest key is present.) - `dns` - `downloads` - `downloads.open` diff --git a/files/en-us/mozilla/firefox/releases/77/index.md b/files/en-us/mozilla/firefox/releases/77/index.md index 6c6b28ea9183c29..6b0e4aa4859e95a 100644 --- a/files/en-us/mozilla/firefox/releases/77/index.md +++ b/files/en-us/mozilla/firefox/releases/77/index.md @@ -63,7 +63,12 @@ This article provides information about the changes in Firefox 77 that will affe ### Manifest changes -- The following permissions are now optional, they can be specified in the [`optional_permissions`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions) manifest key and requested using the {{WebExtAPIRef("permissions")}} API: `browsingData` ([Firefox bug 1630417](https://bugzil.la/1630417)), `pkcs11` ([Firefox bug 1630418](https://bugzil.la/1630418)), `proxy` ([Firefox bug 1548011](https://bugzil.la/1548011)), and `sessions` ([Firefox bug 1630414](https://bugzil.la/1630414)). +- The following permissions are now optional, they can be specified in the [`optional_permissions`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/optional_permissions) manifest key and requested using the {{WebExtAPIRef("permissions")}} API: + - `browsingData` ([Firefox bug 1630417](https://bugzil.la/1630417)) + - `devtools` ([Firefox bug 1606862](https://bugzil.la/1606862)) – by setting this permission, an extension can introduce developer tools panels in an update without the extension being disabled (in Chrome) or blocked from updating (in Firefox). + - `pkcs11` ([Firefox bug 1630418](https://bugzil.la/1630418)) + - `proxy` ([Firefox bug 1548011](https://bugzil.la/1548011)) + - `sessions` ([Firefox bug 1630414](https://bugzil.la/1630414)). ### Other