Commit a3f0d8ec authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

fixup! MB 39: Add home page about:mullvad-browser

MB 411: Use the same update URL in about:mullvad-browser as the about
dialog.
parent 42cae74e
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -5,22 +5,29 @@ export class AboutMullvadBrowserParent extends JSWindowActorParent {
  receiveMessage(message) {
    const shouldNotifyPref = "mullvadbrowser.post_update.shouldNotify";
    switch (message.name) {
      case "AboutMullvadBrowser:GetUpdateData":
      case "AboutMullvadBrowser:GetUpdateData": {
        if (!Services.prefs.getBoolPref(shouldNotifyPref, false)) {
          return Promise.resolve(null);
        }
        Services.prefs.clearUserPref(shouldNotifyPref);
        // Try use the same URL as the about dialog. See mullvad-browser#411.
        let updateURL = Services.urlFormatter.formatURLPref(
          "app.releaseNotesURL.aboutDialog"
        );
        if (updateURL === "about:blank") {
          updateURL = Services.urlFormatter.formatURLPref(
            "startup.homepage_override_url"
          );
        }

        return Promise.resolve({
          version: Services.prefs.getCharPref(
            "browser.startup.homepage_override.mullvadbrowser.version"
          ),
          url:
            Services.prefs.getCharPref("mullvadbrowser.post_update.url", "") ||
            Services.urlFormatter.formatURLPref(
              "startup.homepage_override_url"
            ),
          url: updateURL,
        });
      }
    }
    return undefined;
  }
}