diff --git a/webextensions/background/handle-misc.js b/webextensions/background/handle-misc.js index 82dcef11c..9b1f162f4 100644 --- a/webextensions/background/handle-misc.js +++ b/webextensions/background/handle-misc.js @@ -89,8 +89,14 @@ Background.onDestroy.addListener(() => { function onToolbarButtonClick(tab) { if (mInitializationPhase < PHASE_BACKGROUND_INITIALIZED || - Permissions.requestPostProcess()) + Permissions.requestPostProcess()) { return; + } + + if (Migration.isInitialStartup()) { + Migration.openInitialStartupPage(); + return; + } if (typeof browser.sidebarAction.toggle == 'function') browser.sidebarAction.toggle(); diff --git a/webextensions/background/migration.js b/webextensions/background/migration.js index ba67add2b..d1d4179ee 100644 --- a/webextensions/background/migration.js +++ b/webextensions/background/migration.js @@ -317,6 +317,8 @@ export function migrateConfigs() { configs.configsVersion = kCONFIGS_VERSION; } +let mShouldShowInitialStartupPage = false; + export function tryNotifyNewFeatures() { /* let featuresVersionOffset = 0; @@ -352,6 +354,28 @@ export function tryNotifyNewFeatures() { message: browser.i18n.getMessage(`startup_notification_message_${typeSuffix}${platformSuffix}`), timeout: 90 * 1000 }); + + if (isInitialInstall) { + mShouldShowInitialStartupPage = true; + browser.browserAction.setBadgeText({ + text: '!', + }); + } +} + +export function isInitialStartup() { + return !!mShouldShowInitialStartupPage; +} + +export function openInitialStartupPage() { + mShouldShowInitialStartupPage = false; + browser.browserAction.setBadgeText({ + text: null, + }); + browser.tabs.create({ + url: Constants.kSHORTHAND_URIS.startup, + active: true, + }); }