1- import { isBrowserURL , isFirefox } from "../common/common" ;
1+ import { isBrowserURL } from "../common/common" ;
22import {
33 Commands ,
44 Message ,
@@ -19,21 +19,15 @@ import browser from "webextension-polyfill";
1919
2020browser . runtime . onInstalled . addListener ( async ( { reason } ) => {
2121 // should this be async?
22- // should I do this on update?
23- if ( reason === "install" || reason === "update" ) {
24- // uninstall survey
25- // injectig on update might clash with already installed content script.
26- // inject extension
27- // open the welcome page
22+ if ( reason === "install" ) {
2823 // opening the welcome page first buys the extension time to inject into the avalible pages
29- if ( reason === "install" ) {
30- browser . runtime . setUninstallURL ( "https://forms.gle/Eqi9Hgs86hSVrvT57" ) ;
31- const isMissingCommands = await checkCommands ( ) ;
32- const welcomeUrl = new URL ( "https://tabbutler.netlify.app/welcome" ) ;
33- if ( isMissingCommands ) {
34- // if there are missing/unbound commands, set a query param to show on the welcome page
35- welcomeUrl . searchParams . set ( "missing_commands" , "true" ) ;
36- }
24+ // uninstall survey
25+ browser . runtime . setUninstallURL ( "https://forms.gle/Eqi9Hgs86hSVrvT57" ) ;
26+ const isMissingCommands = await checkCommands ( ) ;
27+ const welcomeUrl = new URL ( "https://tabbutler.netlify.app/welcome" ) ;
28+ if ( isMissingCommands ) {
29+ // if there are missing/unbound commands, set a query param to show on the welcome page
30+ welcomeUrl . searchParams . set ( "missing_commands" , "true" ) ;
3731 await browser . tabs . create ( { url : welcomeUrl . toString ( ) } ) ; // not really nessecary to await
3832 }
3933 await injectExtension ( ) ; // not nessecary to await
0 commit comments