diff options
Diffstat (limited to 'application/palemoon')
-rw-r--r-- | application/palemoon/app/profile/palemoon.js | 9 | ||||
-rw-r--r-- | application/palemoon/base/jar.mn | 2 | ||||
-rw-r--r-- | application/palemoon/components/nsBrowserGlue.js | 59 | ||||
-rw-r--r-- | application/palemoon/confvars.sh | 14 |
4 files changed, 59 insertions, 25 deletions
diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index 20919eca4..f0e860749 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -236,6 +236,15 @@ pref("general.useragent.complexOverride.moodle", false); // bug 797703 // At startup, check if we're the default browser and prompt user if not. pref("browser.shell.checkDefaultBrowser", true); pref("browser.shell.shortcutFavicons",true); +pref("browser.shell.mostRecentDateSetAsDefault", ""); +#ifdef RELEASE_OR_BETA +pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", false); +#else +pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", true); +#endif +pref("browser.shell.skipDefaultBrowserCheck", true); +pref("browser.shell.defaultBrowserCheckCount", 0); +pref("browser.defaultbrowser.notificationbar", false); // 0 = blank, 1 = home (browser.startup.homepage), 2 = last visited page, 3 = resume previous browser session // The behavior of option 3 is detailed at: http://wiki.mozilla.org/Session_Restore diff --git a/application/palemoon/base/jar.mn b/application/palemoon/base/jar.mn index fd2df79e1..622d8e0da 100644 --- a/application/palemoon/base/jar.mn +++ b/application/palemoon/base/jar.mn @@ -108,7 +108,7 @@ browser.jar: * content/browser/sanitize.xul (content/sanitize.xul) * content/browser/sanitizeDialog.js (content/sanitizeDialog.js) content/browser/sanitizeDialog.css (content/sanitizeDialog.css) -* content/browser/autocomplete.css (content/autocomplete.css) + content/browser/autocomplete.css (content/autocomplete.css) * content/browser/autocomplete.xml (content/autocomplete.xml) content/browser/tabbrowser.css (content/tabbrowser.css) * content/browser/tabbrowser.xml (content/tabbrowser.xml) diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 6563df4e6..d1f10111a 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -13,7 +13,11 @@ const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -// Define Lazy Module Gitters +// Define Lazy Service Getters +XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", + "@mozilla.org/alerts-service;1", "nsIAlertsService"); + +// Define Lazy Module Getters [ ["AddonManager", "resource://gre/modules/AddonManager.jsm"], ["NetUtil", "resource://gre/modules/NetUtil.jsm"], @@ -37,10 +41,13 @@ Cu.import("resource://gre/modules/Services.jsm"); ["FormValidationHandler", "resource:///modules/FormValidationHandler.jsm"], ["AutoCompletePopup", "resource:///modules/AutoCompletePopup.jsm"], ["DateTimePickerHelper", "resource://gre/modules/DateTimePickerHelper.jsm"], + ["ShellService", "resource:///modules/ShellService.jsm"], ].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource)); -XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", - "@mozilla.org/alerts-service;1", "nsIAlertsService"); +// Define Lazy Getters +XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() { + return Services.strings.createBundle('chrome://browser/locale/browser.properties'); +}); const PREF_PLUGINS_NOTIFYUSER = "plugins.update.notifyUser"; const PREF_PLUGINS_UPDATEURL = "plugins.update.url"; @@ -562,17 +569,17 @@ BrowserGlue.prototype = { } // Perform default browser checking. - var shell; - try { - shell = Components.classes["@mozilla.org/browser/shell-service;1"] - .getService(Components.interfaces.nsIShellService); - } catch (e) { } - if (shell) { -#ifdef DEBUG - let shouldCheck = false; -#else - let shouldCheck = shell.shouldCheckDefaultBrowser; -#endif + if (ShellService) { + let shouldCheck = ShellService.shouldCheckDefaultBrowser; + + const skipDefaultBrowserCheck = + Services.prefs.getBoolPref("browser.shell.skipDefaultBrowserCheckOnFirstRun") && + Services.prefs.getBoolPref("browser.shell.skipDefaultBrowserCheck"); + + const usePromptLimit = false; + let promptCount = + usePromptLimit ? Services.prefs.getIntPref("browser.shell.defaultBrowserCheckCount") : 0; + let willRecoverSession = false; try { let ss = Cc["@mozilla.org/browser/sessionstartup;1"]. @@ -582,9 +589,25 @@ BrowserGlue.prototype = { } catch (ex) { /* never mind; suppose SessionStore is broken */ } - let isDefault = shell.isDefaultBrowser(true, false); // startup check, check all assoc + // startup check, check all assoc + let isDefault = false; + let isDefaultError = false; + try { + isDefault = ShellService.isDefaultBrowser(true, false); + } catch (ex) { + isDefaultError = true; + } + + if (isDefault) { + let now = (Math.floor(Date.now() / 1000)).toString(); + Services.prefs.setCharPref("browser.shell.mostRecentDateSetAsDefault", now); + } + + let willPrompt = shouldCheck && !isDefault && !willRecoverSession; - if (shouldCheck && !isDefault && !willRecoverSession) { + // Skip the "Set Default Browser" check during first-run or after the + // browser has been run a few times. + if (willPrompt) { Services.tm.mainThread.dispatch(function() { var win = this.getMostRecentBrowserWindow(); var brandBundle = win.document.getElementById("bundle_brand"); @@ -613,9 +636,9 @@ BrowserGlue.prototype = { claimAllTypes = (parseFloat(version) < 6.2); } catch (ex) { } #endif - shell.setDefaultBrowser(claimAllTypes, false); + ShellService.setDefaultBrowser(claimAllTypes, false); } - shell.shouldCheckDefaultBrowser = checkEveryTime.value; + ShellService.shouldCheckDefaultBrowser = checkEveryTime.value; }.bind(this), Ci.nsIThread.DISPATCH_NORMAL); } } diff --git a/application/palemoon/confvars.sh b/application/palemoon/confvars.sh index 8a1d00c68..5109c0829 100644 --- a/application/palemoon/confvars.sh +++ b/application/palemoon/confvars.sh @@ -79,12 +79,6 @@ MOZ_JSDOWNLOADS=1 # conformant implementations. MOZ_WEBGL_CONFORMANT=1 -# Platform Feature: Windows Maintaince Service -# XXX: This is never used -if test "$OS_ARCH" = "WINNT"; then - MOZ_MAINTENANCE_SERVICE= -fi - # Set the chrome packing format # Possible values are omni, jar, and flat # Currently, only omni and flat are supported @@ -103,3 +97,11 @@ if test "$OS_ARCH" = "WINNT" -o \ "$OS_ARCH" = "Linux"; then MOZ_BUNDLED_FONTS=1 fi + +# Short-circuit a few services to be removed +MOZ_MAINTENANCE_SERVICE= +MOZ_SERVICES_HEALTHREPORT= +MOZ_ADDON_SIGNING=0 +MOZ_REQUIRE_SIGNING=0 +MOZ_PROFILE_MIGRATOR= + |