not adding the listener if the early exit condition is met
This commit is contained in:
parent
9f71956cd2
commit
b80ad8be3f
1 changed files with 3 additions and 2 deletions
|
|
@ -107,9 +107,10 @@ async function openChatGPT(promptText, action, curr_tabId) {
|
|||
// Early exit if loaded already
|
||||
if (tabIsLoaded(createdTab)) {
|
||||
resolve();
|
||||
} else {
|
||||
browser.tabs.onUpdated.addListener(listener);
|
||||
}
|
||||
browser.tabs.onUpdated.addListener(listener);
|
||||
})
|
||||
});
|
||||
|
||||
browser.tabs.executeScript(createdTab.id, { code: mzta_script, matchAboutBlank: false })
|
||||
.then(async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue