From 7c18de8eb836181903ec07078a9fce943280f534 Mon Sep 17 00:00:00 2001 From: daniel k Date: Sat, 3 Feb 2024 21:49:46 +0900 Subject: [PATCH] refactor background comment --- src/background.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/background.js b/src/background.js index 86323da7..72949e62 100644 --- a/src/background.js +++ b/src/background.js @@ -17,16 +17,16 @@ var stopTtsTimestamp = 0; (async function backgroundInit() { try { - injectContentScriptForAllTab(); - addInstallUrl(introSiteUrl); + injectContentScriptForAllTab(); // check extension updated, then re inject content script + addInstallUrl(introSiteUrl); // check first start and redirect to how to use url // addUninstallUrl(util.getReviewUrl()); - await getSetting(); - addCopyRequestListener(); - addTabSwitchEventListener(); - addPdfFileTabListener(); - addSearchBarListener(); - addMessageListener(); + await getSetting(); // load setting + addCopyRequestListener(); // listen copy context menu and shortcut key + addTabSwitchEventListener(); // listen tab switch for kill tts + addPdfFileTabListener(); //listen drag and drop pdf + addSearchBarListener(); // listen url search bar for translate omnibox + addMessageListener(); // listen message from content script for handle translate & tts } catch (error) { console.log(error); }