Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions packages/wxt/src/core/utils/__tests__/manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,28 @@ describe('Manifest Utils', () => {

expect(actual.options_ui).toEqual(expected);
});

it('should exclude open_in_tab for safari', async () => {
setFakeWxt({
config: {
manifestVersion: 3,
browser: 'safari',
outDir,
},
});
const buildOutput = fakeBuildOutput();

const { manifest: actual } = await generateManifest(
[options],
buildOutput,
);

expect(actual.options_ui).toEqual({
chrome_style: true,
page: 'options.html',
});
expect(actual.options_ui?.open_in_tab).toBeUndefined();
});
});

describe('background', () => {
Expand Down
5 changes: 3 additions & 2 deletions packages/wxt/src/core/utils/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,9 @@ function addEntrypoints(
if (options) {
const page = getEntrypointBundlePath(options, wxt.config.outDir, '.html');
manifest.options_ui = {
open_in_tab: options.options.openInTab ?? false,
// @ts-expect-error: Not typed by @wxt-dev/browser, but supported by Firefox
...(wxt.config.browser !== 'safari' && {
open_in_tab: options.options.openInTab ?? false,
}),
browser_style:
wxt.config.browser === 'firefox'
? options.options.browserStyle
Expand Down