few bug fixes

This commit is contained in:
n4ze3m
2024-05-12 11:38:01 +05:30
parent f9f621c920
commit 79e2013fbd
7 changed files with 225 additions and 243 deletions

25
src/utils/action.ts Normal file
View File

@@ -0,0 +1,25 @@
import { browser } from "wxt/browser"
export const setTitle = ({ title }: { title: string }) => {
if (import.meta.env.BROWSER === "chrome") {
chrome.action.setTitle({ title })
} else {
browser.browserAction.setTitle({ title })
}
}
export const setBadgeBackgroundColor = ({ color }: { color: string }) => {
if (import.meta.env.BROWSER === "chrome") {
chrome.action.setBadgeBackgroundColor({ color })
} else {
browser.browserAction.setBadgeBackgroundColor({ color })
}
}
export const setBadgeText = ({ text }: { text: string }) => {
if (import.meta.env.BROWSER === "chrome") {
chrome.action.setBadgeText({ text })
} else {
browser.browserAction.setBadgeText({ text })
}
}