Skip to content

Commit bba4201

Browse files
authored
fix: Remove tabs permission to avoid new warnings cp-13.10.1 (#38075)
## **Description** The recent addition of the `tabs` permission will result in new permission warnings upon update, which is extremely disruptive and is something we'd never do except as a last resort. The permission wasn't actually needed, and has been removed. This removal uncovered a bug in our Webpack build (the `tabs` permission was erroneously only added for MV2 test builds, but we need it for MV3 test builds as well), which has been fixed. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/38075?quickstart=1) ## **Changelog** CHANGELOG entry: Remove unnecessary extension permission ## **Related issues** N/A ## **Manual testing steps** Test that the sidepanel still works in general. Particularly with dapp confirmations, and the "Connected status" indicator, and current selected dapp. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Removes `tabs` from the MV3 manifest and updates the build transform to add `tabs` only for test builds (all manifest versions). > > - **Manifest (MV3)**: > - Remove `tabs` from `permissions` in `app/manifest/v3/_base.json`. > - **Build/Manifest transform**: > - Update `transformManifest` in `development/webpack/utils/plugins/ManifestPlugin/helpers.ts` to add `tabs` when `args.test` is true, regardless of `manifest_version`. > - Retains error if `tabs` already exists and continues adding dev/test manifest key. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 862591e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 99a7347 commit bba4201

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

app/manifest/v3/_base.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
"notifications",
8585
"scripting",
8686
"storage",
87-
"tabs",
8887
"unlimitedStorage",
8988
"webRequest",
9089
"offscreen",

development/webpack/utils/plugins/ManifestPlugin/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ export function transformManifest(
8282
}
8383
}
8484

85-
if (args.test && args.manifest_version === 2) {
86-
// test builds need "tabs" permission for switchToWindowWithTitle in MV2
85+
if (args.test) {
86+
// test builds need "tabs" permission for switchToWindowWithTitle
8787
transforms.push(addTabsPermission);
8888
}
8989

0 commit comments

Comments
 (0)