Skip to content

Commit aff0bb4

Browse files
committed
fix: 某些情况下菜单注册后不显示
1 parent 3fb62ba commit aff0bb4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/apps/script/manager.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ export class ScriptManager extends Manager {
723723
//name去重
724724
for (let i = 0; i < scriptMenu.length; i++) {
725725
if (scriptMenu[i].name == param.name) {
726+
scriptMenu[i] = param;
726727
return;
727728
}
728729
}
@@ -736,6 +737,7 @@ export class ScriptManager extends Manager {
736737
}
737738
for (let i = 0; i < scriptMenu.length; i++) {
738739
if (scriptMenu[i].name == param.name) {
740+
scriptMenu[i] = param;
739741
return;
740742
}
741743
}
@@ -765,11 +767,11 @@ export class ScriptManager extends Manager {
765767
AppEvent.trigger(TabRemove, tabId);
766768
});
767769
chrome.tabs.onUpdated.addListener((tabId, info) => {
768-
if (info.status != "loading") {
770+
if (info.status === undefined || info.status == "unloaded") {
771+
runMenu.delete(tabId);
772+
AppEvent.trigger(TabRemove, tabId);
769773
return;
770774
}
771-
runMenu.delete(tabId);
772-
AppEvent.trigger(TabRemove, tabId);
773775
});
774776
this.listenerMessage(RequestTabRunScript, (val) => {
775777
return {

src/views/pages/Popup/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,5 +254,4 @@ export default class Popup extends Vue {
254254
padding: 0px;
255255
padding-left: 16px;
256256
}
257-
258257
</style>

0 commit comments

Comments
 (0)