diff --git a/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/eval/index.md b/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/eval/index.md index ba7877f765fa3d7..663a38c40628e8b 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/eval/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/eval/index.md @@ -18,6 +18,8 @@ The script is evaluated by default in the main frame of the page. The script mus You can't call `eval()` on privileged browser windows such as "about:addons". +In Firefox 153 and later, calling `eval()` on a `file://` URL requires the extension to be granted file scheme access by the user. Without this permission, the promise rejects with an error. Use {{WebExtAPIRef("extension.isAllowedFileSchemeAccess()")}} to check whether the user has granted the extension this permission. + You can optionally provide an `options` parameter, which includes options to evaluate the script in a different frame or in the context of attached content scripts. Note that Firefox does not yet support the `options` parameter. The `eval()` function returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that resolves to the evaluated result of the script or to an error. diff --git a/files/en-us/mozilla/add-ons/webextensions/api/extension/index.md b/files/en-us/mozilla/add-ons/webextensions/api/extension/index.md index 75f9f0b6792a8fa..27b9458b85787f5 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/extension/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/extension/index.md @@ -34,9 +34,9 @@ Utilities related to your extension. Get URLs to resources packages with your ex - {{WebExtAPIRef("extension.getViews()")}} - : Returns an array of the [`Window`](/en-US/docs/Web/API/Window) objects for each of the pages running inside the current extension. - {{WebExtAPIRef("extension.isAllowedIncognitoAccess()")}} - - : Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled '_Allowed in Incognito_' checkbox). + - : Retrieves the state of the extension's access to tabs opened in "private browsing" mode (as determined by the user-controlled '_Run in Private Windows_' option in the extension's permissions). - {{WebExtAPIRef("extension.isAllowedFileSchemeAccess()")}} - - : Retrieves the state of the extension's access to the `file://` scheme (as determined by the user-controlled '_Allow access to File URLs_' checkbox). + - : Retrieves the state of the extension's access to the `file://` scheme (as determined by the user-controlled '_Access local files on your computer_' option in the extension's permissions). - {{WebExtAPIRef("extension.sendRequest()")}} {{deprecated_inline}} - : Sends a single request to other listeners within the extension. - {{WebExtAPIRef("extension.setUpdateUrlData()")}} diff --git a/files/en-us/mozilla/add-ons/webextensions/api/extension/isallowedfileschemeaccess/index.md b/files/en-us/mozilla/add-ons/webextensions/api/extension/isallowedfileschemeaccess/index.md index d492a44284e3916..e77bad520a512ab 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/extension/isallowedfileschemeaccess/index.md +++ b/files/en-us/mozilla/add-ons/webextensions/api/extension/isallowedfileschemeaccess/index.md @@ -8,8 +8,6 @@ sidebar: addonsidebar Returns `true` if the extension can access the "file://" scheme, `false` otherwise. -This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). - ## Syntax ```js-nolint @@ -22,9 +20,7 @@ None. ### Return value -A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be fulfilled with a boolean: `true` if the extension is allowed access to "file://" URLs, `false` otherwise. - -Firefox will always return `false`. +A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) fulfilled with a boolean: `true` if the extension is allowed access to "file://" URLs, `false` otherwise. ## Examples diff --git a/files/en-us/mozilla/firefox/releases/153/index.md b/files/en-us/mozilla/firefox/releases/153/index.md index 0017fcdd277dc3b..b1e63e58194399c 100644 --- a/files/en-us/mozilla/firefox/releases/153/index.md +++ b/files/en-us/mozilla/firefox/releases/153/index.md @@ -72,6 +72,8 @@ Firefox 153 is the current [Nightly version of Firefox](https://www.firefox.com/ ## Changes for add-on developers +- Extensions now require explicit user permission to access `file://` URLs. Previously, access to local files was covered by the "Access your data for all websites" host permission. This change introduces a separate "Access local files on your computer" option in the extension's permissions settings (desktop only), and file access is turned off by default for all extensions, including existing ones. The {{WebExtAPIRef("extension.isAllowedFileSchemeAccess()")}} method now correctly returns `true` if the user has granted file scheme access; previously, Firefox always returned `false`. Additionally, calling {{WebExtAPIRef("devtools.inspectedWindow.eval()")}} on `file://` URLs now requires this permission. ([Firefox bug 2034168](https://bugzil.la/2034168)) +