Compare commits

...

2 Commits

Author SHA1 Message Date
GitHub Actions d580083727 chore(release): v0.8.4 2023-10-20 15:26:38 +00:00
Aaron 5a70d9e57d fix: Allow actions without a popup (#181) 2023-10-20 10:20:40 -05:00
5 changed files with 45 additions and 11 deletions
+8
View File
@@ -1,5 +1,13 @@
# Changelog
## v0.8.4
[compare changes](https://github.com/wxt-dev/wxt/compare/v0.8.3...v0.8.4)
### 🩹 Fixes
- Allow actions without a popup ([#181](https://github.com/wxt-dev/wxt/pull/181))
## v0.8.3
[compare changes](https://github.com/wxt-dev/wxt/compare/v0.8.2...v0.8.3)
+25
View File
@@ -599,4 +599,29 @@ describe('Manifest Content', () => {
},
);
});
it('should respect the action field in the manifest without a popup', async () => {
const project = new TestProject();
project.setConfigFileConfig({
manifest: {
action: {
default_title: 'Hello world',
},
},
});
await project.build();
expect(await project.getOutputManifest()).toMatchInlineSnapshot(`
{
"action": {
"default_title": "Hello world",
},
"description": "Example description",
"manifest_version": 3,
"name": "E2E Extension",
"version": "0.0.0",
}
`);
});
});
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "wxt",
"type": "module",
"version": "0.8.3",
"version": "0.8.4",
"description": "Next gen framework for developing web extensions",
"engines": {
"node": ">=18",
-4
View File
@@ -468,17 +468,13 @@ export interface ExcludableEntrypoint {
export type UserManifest = Partial<
Omit<
Manifest.WebExtensionManifest,
| 'action'
| 'background'
| 'browser_action'
| 'chrome_url_overrides'
| 'devtools_page'
| 'manifest_version'
| 'options_page'
| 'options_ui'
| 'sandbox'
| 'page_action'
| 'popup'
| 'sidepanel'
| 'sidebar_action'
>
+11 -6
View File
@@ -214,18 +214,23 @@ function addEntrypoints(
config.outDir,
'.html',
);
const options: Manifest.ActionManifest = {
default_icon: popup.options.defaultIcon,
default_title: popup.options.defaultTitle,
browser_style: popup.options.browserStyle,
};
const options: Manifest.ActionManifest = {};
if (popup.options.defaultIcon)
options.default_icon = popup.options.defaultIcon;
if (popup.options.defaultTitle)
options.default_title = popup.options.defaultTitle;
if (popup.options.browserStyle)
options.browser_style = popup.options.browserStyle;
if (manifest.manifest_version === 3) {
manifest.action = {
...(manifest.action ?? {}),
...options,
default_popup,
};
} else {
manifest[popup.options.mv2Key ?? 'browser_action'] = {
const key = popup.options.mv2Key ?? 'browser_action';
manifest[key] = {
...(manifest[key] ?? {}),
...options,
default_popup,
};