Skip to content

Commit

Permalink
🔥 移除document-body和document-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Nov 16, 2022
1 parent 43b407a commit 06dfc18
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 11 additions & 6 deletions src/pages/popup/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ function App() {
const message = IoC.instance(MessageInternal) as MessageInternal;
useEffect(() => {
systemManage.getNotice().then((res) => {
setNotice(res.notice);
setIsRead(res.isRead);
if (res) {
setNotice(res.notice);
setIsRead(res.isRead);
}
});
systemManage.getVersion().then((res) => {
setVersion(res);
res && setVersion(res);
});
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
if (!tabs.length) {
Expand Down Expand Up @@ -89,8 +91,10 @@ function App() {
type="text"
icon={<IconHome />}
iconOnly
href="/src/options.html"
target="_blank"
onClick={() => {
// 用a链接的方式,vivaldi竟然会直接崩溃
window.open("/src/options.html", "_blank");
}}
/>
<Badge count={isRead ? 0 : 1} dot offset={[-8, 6]}>
<Button
Expand Down Expand Up @@ -121,7 +125,8 @@ function App() {
},
});
window.open(
"/src/options.html#/script/editor?target=initial"
"/src/options.html#/script/editor?target=initial",
"_blank"
);
}
});
Expand Down
4 changes: 0 additions & 4 deletions src/runtime/background/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,17 +372,13 @@ export default class Runtime extends Manager {
[runAt] = script.metadata["run-at"];
}
switch (runAt) {
case "document-body":
case "document-menu":
case "document-start":
runAt = "document_start";
break;
case "document-end":
runAt = "document_end";
break;
case "document-idle":
runAt = "document_idle";
break;
default:
runAt = "document_idle";
break;
Expand Down

0 comments on commit 06dfc18

Please sign in to comment.