Add go home links in popup menu

This commit is contained in:
Paul
2024-03-22 16:22:33 +08:00
parent 3590d158f5
commit 56734429a7
2 changed files with 15 additions and 3 deletions
+9 -2
View File
@@ -8,8 +8,6 @@ import "assets/global.less";
import styles from "./popup.module.less";
function IndexPopup() {
const [data, setData] = useState("")
const [tab, setTab] = useState<string>();
const onBack = () => {
@@ -21,6 +19,15 @@ function IndexPopup() {
chrome.runtime.openOptionsPage();
return;
}
else if (value === "home") {
chrome.storage.local.get(["siteUrl"]).then((res) => {
if (res.siteUrl) {
chrome.tabs.create({ url: res.siteUrl });
}
});
return;
}
setTab(value);
}