Skip to content

Commit

Permalink
fix: 某些情况下菜单注册后不显示
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Nov 9, 2021
1 parent 3fb62ba commit aff0bb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/apps/script/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@ export class ScriptManager extends Manager {
//name去重
for (let i = 0; i < scriptMenu.length; i++) {
if (scriptMenu[i].name == param.name) {
scriptMenu[i] = param;
return;
}
}
Expand All @@ -736,6 +737,7 @@ export class ScriptManager extends Manager {
}
for (let i = 0; i < scriptMenu.length; i++) {
if (scriptMenu[i].name == param.name) {
scriptMenu[i] = param;
return;
}
}
Expand Down Expand Up @@ -765,11 +767,11 @@ export class ScriptManager extends Manager {
AppEvent.trigger(TabRemove, tabId);
});
chrome.tabs.onUpdated.addListener((tabId, info) => {
if (info.status != "loading") {
if (info.status === undefined || info.status == "unloaded") {
runMenu.delete(tabId);
AppEvent.trigger(TabRemove, tabId);
return;
}
runMenu.delete(tabId);
AppEvent.trigger(TabRemove, tabId);
});
this.listenerMessage(RequestTabRunScript, (val) => {
return {
Expand Down
1 change: 0 additions & 1 deletion src/views/pages/Popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,4 @@ export default class Popup extends Vue {
padding: 0px;
padding-left: 16px;
}
</style>

0 comments on commit aff0bb4

Please sign in to comment.