Skip to content

Commit 5fcaf7c

Browse files
committed
fix: Automatically detect and add "sidePanel" permission
1 parent c74e530 commit 5fcaf7c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: packages/wxt/src/core/utils/__tests__/manifest.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,7 @@ describe('Manifest Utils', () => {
897897

898898
describe('sidepanel', () => {
899899
it.each(['chrome', 'safari', 'edge'])(
900-
'should include a side_panel ignoring all options for %s',
900+
'should include the side_panel and permission, ignoring all options for %s',
901901
async (browser) => {
902902
const sidepanel = fakeSidepanelEntrypoint({
903903
outputDir: outDir,
@@ -909,12 +909,14 @@ describe('Manifest Utils', () => {
909909
manifestVersion: 3,
910910
browser,
911911
outDir,
912+
command: 'build',
912913
},
913914
});
914915
const expected = {
915916
side_panel: {
916917
default_path: 'sidepanel.html',
917918
},
919+
permissions: ['sidePanel'],
918920
};
919921

920922
const { manifest: actual } = await generateManifest(

Diff for: packages/wxt/src/core/utils/manifest.ts

+1
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ function addEntrypoints(
347347
manifest.side_panel = {
348348
default_path: page,
349349
};
350+
addPermission(manifest, 'sidePanel');
350351
} else {
351352
wxt.logger.warn(
352353
'Side panel not supported by Chromium using MV2. side_panel.default_path was not added to the manifest',

0 commit comments

Comments
 (0)