fix(manifest): exclude open_in_tab from options_ui for Safari (#2311)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Aaron <aaronklinker1@gmail.com>
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
@@ -333,7 +333,9 @@ function addEntrypoints(
|
||||
if (options) {
|
||||
const page = getEntrypointBundlePath(options, wxt.config.outDir, '.html');
|
||||
manifest.options_ui = {
|
||||
open_in_tab: options.options.openInTab ?? false,
|
||||
...(wxt.config.browser !== 'safari' && {
|
||||
open_in_tab: options.options.openInTab ?? false,
|
||||
}),
|
||||
// @ts-expect-error: Not typed by @wxt-dev/browser, but supported by Firefox
|
||||
browser_style:
|
||||
wxt.config.browser === 'firefox'
|
||||
|
||||
Reference in New Issue
Block a user