Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around welcome page disappearing post install #2798

Merged
merged 1 commit into from
Sep 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,19 @@ function Badger() {
// set up periodic fetching of hashes from eff.org
setInterval(self.updateDntPolicyHashes.bind(self), utils.oneDay() * 4);

let privateStore = self.getPrivateSettings();
if (self.isFirstRun) {
// work around the welcome page getting closed by an extension restart
// such as in response to being granted Private Browsing permission
// from the post-install doorhanger on Firefox
setTimeout(function () {
privateStore.setItem("firstRunTimerFinished", true);
}, utils.oneMinute());

self.showFirstRunPage();

} else if (!privateStore.getItem("firstRunTimerFinished")) {
privateStore.setItem("firstRunTimerFinished", true);
self.showFirstRunPage();
}
});
Expand Down Expand Up @@ -880,8 +892,14 @@ Badger.prototype = {
}

// initialize any other private store (not-for-export) settings
if (!privateStore.hasItem("showLearningPrompt")) {
privateStore.setItem("showLearningPrompt", false);
let privateDefaultSettings = {
"firstRunTimerFinished": false,
"showLearningPrompt": false,
};
for (let key of Object.keys(privateDefaultSettings)) {
if (!privateStore.hasItem(key)) {
privateStore.setItem(key, privateDefaultSettings[key]);
}
}
badger.initDeprecations();

Expand Down