Skip to content

Commit

Permalink
Disable onboarding and upgrade dialogs
Browse files Browse the repository at this point in the history
Runtime Firefox should no longer display onboarding and upgrade dialogs after upgrading it. Private window separation should now also be disabled.

Maybe related to #205, #210 and #211.
  • Loading branch information
filips123 committed Sep 18, 2022
1 parent 2dc9cc5 commit ac79e55
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions native/userchrome/profile/chrome/pwa/content/browser.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,7 @@ class PwaBrowser {
this.configureLayout();
this.configureWidgets();
this.configureSettings();
this.disableOnboarding();
}

configureLayout () {
Expand Down Expand Up @@ -1624,7 +1625,11 @@ class PwaBrowser {
xPref.set('browser.tabs.warnOnClose', false, true);
xPref.set('browser.sessionstore.resume_from_crash', false, true);
xPref.set('browser.shell.checkDefaultBrowser', false, true);
xPref.set('browser.startup.upgradeDialog.enabled', false, true);
xPref.set('browser.aboutwelcome.enabled', false, true);
xPref.set('browser.messaging-system.whatsNewPanel.enabled', false, true);
xPref.set('browser.privateWindowSeparation.enabled', false, true);
xPref.set('browser.privacySegmentation.createdShortcut', true, true);
xPref.set('browser.uidensity', 1, true);
xPref.set('browser.link.open_newwindow', 1, true);
xPref.set('datareporting.policy.firstRunURL', '', true);
Expand Down Expand Up @@ -1687,6 +1692,16 @@ class PwaBrowser {
xPref.set(ChromeLoader.PREF_ALLOWED_DOMAINS, '', true);
}

disableOnboarding () {
const { OnboardingMessageProvider } = ChromeUtils.import('resource://activity-stream/lib/OnboardingMessageProvider.jsm');
OnboardingMessageProvider.getMessages = async () => [];
OnboardingMessageProvider.getUntranslatedMessages = async () => [];
OnboardingMessageProvider.getUntranslatedMessages = async () => null;

const { BrowserGlue } = ChromeUtils.import('resource:///modules/BrowserGlue.jsm');
BrowserGlue.prototype._maybeShowDefaultBrowserPrompt = async () => null;
}

//////////////////////////////
// Utils
//////////////////////////////
Expand Down

0 comments on commit ac79e55

Please sign in to comment.