Skip to content

Commit bcc0f05

Browse files
committed
switch to wxt
1 parent e82a21c commit bcc0f05

20 files changed

+2819
-1608
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
node_modules
22
npm_debug.log
3-
src.zip
3+
src.zip
4+
5+
.wxt
6+
.output

bun.lock

Lines changed: 1160 additions & 0 deletions
Large diffs are not rendered by default.

entrypoints/background.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
function openOptionsPage() {
2+
if (browser.runtime.openOptionsPage) {
3+
browser.runtime.openOptionsPage();
4+
} else {
5+
window.open(browser.runtime.getURL("/options.html"));
6+
}
7+
}
8+
9+
export default defineBackground({
10+
main() {
11+
browser?.browserAction?.onClicked?.addListener(openOptionsPage);
12+
browser?.action?.onClicked?.addListener(openOptionsPage);
13+
browser.runtime.onMessage.addListener((message) => {
14+
if (message.action === "openOptionsPage") {
15+
openOptionsPage();
16+
}
17+
});
18+
},
19+
});

0 commit comments

Comments
 (0)