summaryrefslogtreecommitdiffstats
path: root/application/palemoon/base/content/autorecovery.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-12-14 14:37:24 -0500
committerMatt A. Tobin <email@mattatobin.com>2019-12-14 14:37:24 -0500
commit4e34c57467a8d38d593c6fbb7c0d63c3257e99f0 (patch)
treeff5ee62f90cebe34f23f734669e2c526d783caf0 /application/palemoon/base/content/autorecovery.js
parentdacb3da00bd17e69f1a8f1080668808a5f3fe431 (diff)
downloadUXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.tar
UXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.tar.gz
UXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.tar.lz
UXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.tar.xz
UXP-4e34c57467a8d38d593c6fbb7c0d63c3257e99f0.zip
Remove Pale Moon from the Unified XUL Platform repository
Development will proceed at https://github.com/MoonchildProductions/Pale-Moon
Diffstat (limited to 'application/palemoon/base/content/autorecovery.js')
-rw-r--r--application/palemoon/base/content/autorecovery.js60
1 files changed, 0 insertions, 60 deletions
diff --git a/application/palemoon/base/content/autorecovery.js b/application/palemoon/base/content/autorecovery.js
deleted file mode 100644
index 01a092f5c..000000000
--- a/application/palemoon/base/content/autorecovery.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Auto-recovery module.
- * This module aims to catch fatal browser initialization errors and either
- * automatically correct likely causes from them, or automatically restarting
- * the browser in safe mode. This is hooked into the browser's "onload"
- * event because it can be assumed that at that point, everything must
- * have been properly initialized already.
- */
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-
-// Services = object with smart getters for common XPCOM services
-Cu.import("resource://gre/modules/Services.jsm");
-
-var browser_autoRecovery =
-{
- onLoad: function() {
-
- var nsIAS = Ci.nsIAppStartup; // Application startup interface
-
- if (typeof gBrowser === "undefined") {
- // gBrowser should always be defined at this point, but if it is not, then most likely
- // it is due to an incompatible or outdated language pack being installed and selected.
- // In this case, we reset "general.useragent.locale" to try to recover browser startup.
- if (Services.prefs.prefHasUserValue("general.useragent.locale")) {
- // Restart automatically in en-US.
- Services.prefs.clearUserPref("general.useragent.locale");
- Cc["@mozilla.org/toolkit/app-startup;1"].getService(nsIAS).quit(nsIAS.eRestart | nsIAS.eAttemptQuit);
- } else if (!Services.appinfo.inSafeMode) {
- // gBrowser isn't defined, and we're not using a custom locale. Most likely
- // a user-installed add-on causes issues here, so we restart in Safe Mode.
- let RISM = Services.prompt.confirm(null, "Error",
- "The Browser didn't start properly!\n"+
- "This is usually caused by an add-on or misconfiguration.\n\n"+
- "Restart in Safe Mode?");
- if (RISM) {
- Cc["@mozilla.org/toolkit/app-startup;1"].getService(nsIAS).restartInSafeMode(nsIAS.eRestart | nsIAS.eAttemptQuit);
- } else {
- // Force quit application
- Cc["@mozilla.org/toolkit/app-startup;1"].getService(nsIAS).quit(nsIAS.eForceQuit);
- }
- }
- // Something else caused this issue and we're already in Safe Mode, so we return
- // without doing anything else, and let normal error handling take place.
- return;
- } // gBrowser undefined
-
- // Other checks than gBrowser undefined can go here!
-
- // Remove our listener, since we don't want this to fire on every load.
- window.removeEventListener("load", browser_autoRecovery.onLoad, false);
- }
-};
-
-window.addEventListener("load", browser_autoRecovery.onLoad, false);