feat: Support browser and chrome styles for mv2 popups

This commit is contained in:
Aaron Klinker
2023-06-24 19:33:26 -05:00
parent 0f37ceb774
commit 7abb577254
2 changed files with 18 additions and 8 deletions
@@ -43,11 +43,6 @@ describe('findEntrypoints', () => {
mode: 'production',
};
beforeEach(() => {
vi.resetAllMocks();
vi.restoreAllMocks();
});
it.each<[string, string, PopupEntrypoint]>([
[
'popup.html',
+18 -3
View File
@@ -157,11 +157,26 @@ async function getOptionsEntrypoint(
const content = await fs.readFile(path, 'utf-8');
const { document } = parseHTML(content);
const defaultIconContent = document
const openInTabContent = document
.querySelector("meta[name='manifest.open_in_tab']")
?.getAttribute('content');
if (defaultIconContent) {
options.openInTab = Boolean(defaultIconContent);
if (openInTabContent) {
options.openInTab = Boolean(openInTabContent);
}
const chromeStyleContent = document
.querySelector("meta[name='manifest.chrome_style']")
?.getAttribute('content');
if (chromeStyleContent) {
options.chromeStyle = Boolean(chromeStyleContent);
}
const browserStyleContent = document
.querySelector("meta[name='manifest.browser_style']")
?.getAttribute('content');
if (browserStyleContent) {
options.browserStyle = Boolean(browserStyleContent);
}
return {