summaryrefslogtreecommitdiffstats
path: root/application/palemoon/base/content/utilityOverlay.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-02-06 15:59:19 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-02-06 15:59:19 +0100
commitd9a05498806ede2978623019ce222150c5cfcef5 (patch)
treeee015f74b4bb93b4c009e86ebb7909f4e92401cf /application/palemoon/base/content/utilityOverlay.js
parente057156093c5ff2fbb13110dd62bbca2e52bd6c7 (diff)
downloadUXP-d9a05498806ede2978623019ce222150c5cfcef5.tar
UXP-d9a05498806ede2978623019ce222150c5cfcef5.tar.gz
UXP-d9a05498806ede2978623019ce222150c5cfcef5.tar.lz
UXP-d9a05498806ede2978623019ce222150c5cfcef5.tar.xz
UXP-d9a05498806ede2978623019ce222150c5cfcef5.zip
Add "check for updates" to main menu and AppMenu
Tag #963.
Diffstat (limited to 'application/palemoon/base/content/utilityOverlay.js')
-rw-r--r--application/palemoon/base/content/utilityOverlay.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/application/palemoon/base/content/utilityOverlay.js b/application/palemoon/base/content/utilityOverlay.js
index 2c1a95f83..a37ce1d3e 100644
--- a/application/palemoon/base/content/utilityOverlay.js
+++ b/application/palemoon/base/content/utilityOverlay.js
@@ -590,6 +590,29 @@ function openAdvancedPreferences(tabID)
openPreferences("paneAdvanced", { "advancedTab" : tabID });
}
+#ifdef MOZ_UPDATER
+/**
+ * Opens the update manager and checks for updates to the application.
+ */
+function checkForUpdates()
+{
+ var um =
+ Components.classes["@mozilla.org/updates/update-manager;1"].
+ getService(Components.interfaces.nsIUpdateManager);
+ var prompter =
+ Components.classes["@mozilla.org/updates/update-prompt;1"].
+ createInstance(Components.interfaces.nsIUpdatePrompt);
+
+ // If there's an update ready to be applied, show the "Update Downloaded"
+ // UI instead and let the user know they have to restart the browser for
+ // the changes to be applied.
+ if (um.activeUpdate && um.activeUpdate.state == "pending")
+ prompter.showUpdateDownloaded(um.activeUpdate);
+ else
+ prompter.checkForUpdates();
+}
+#endif
+
/**
* Opens the troubleshooting information (about:support) page for this version
* of the application.