Skip to content

Commit

Permalink
fix: Automatically detect and add "sidePanel" permission
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed May 8, 2024
1 parent c74e530 commit 5fcaf7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/wxt/src/core/utils/__tests__/manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ describe('Manifest Utils', () => {

describe('sidepanel', () => {
it.each(['chrome', 'safari', 'edge'])(
'should include a side_panel ignoring all options for %s',
'should include the side_panel and permission, ignoring all options for %s',
async (browser) => {
const sidepanel = fakeSidepanelEntrypoint({
outputDir: outDir,
Expand All @@ -909,12 +909,14 @@ describe('Manifest Utils', () => {
manifestVersion: 3,
browser,
outDir,
command: 'build',
},
});
const expected = {
side_panel: {
default_path: 'sidepanel.html',
},
permissions: ['sidePanel'],
};

const { manifest: actual } = await generateManifest(
Expand Down
1 change: 1 addition & 0 deletions packages/wxt/src/core/utils/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ function addEntrypoints(
manifest.side_panel = {
default_path: page,
};
addPermission(manifest, 'sidePanel');
} else {
wxt.logger.warn(
'Side panel not supported by Chromium using MV2. side_panel.default_path was not added to the manifest',
Expand Down

0 comments on commit 5fcaf7c

Please sign in to comment.