Bug 746848. Support pref for webapps installer dry-run. r=gavin a=desktop-only
authorFelipe Gomes <felipc@gmail.com>
Thu, 19 Apr 2012 18:47:52 -0700
changeset 91969 ac6e651207d3fe55b8f168c28c9568b00a6c8306
parent 91968 3e2557ca55d665956268f63870c18264ee28da1a
child 91970 ebec7bc561e1905612befb1d07292903e702472c
push id22495
push userfelipc@gmail.com
push dateFri, 20 Apr 2012 01:49:42 +0000
treeherdermozilla-central@22bfdebf5cae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin, desktop-only
bugs746848
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 746848. Support pref for webapps installer dry-run. r=gavin a=desktop-only
browser/modules/WebappsInstaller.jsm
--- a/browser/modules/WebappsInstaller.jsm
+++ b/browser/modules/WebappsInstaller.jsm
@@ -17,16 +17,22 @@ let WebappsInstaller = {
    * Creates a native installation of the web app in the OS
    *
    * @param aData the manifest data provided by the web app
    *
    * @returns bool true on success, false if an error was thrown
    */
   install: function(aData) {
 
+    try {
+      if (Services.prefs.getBoolPref("browser.mozApps.installer.dry_run")) {
+        return true;
+      }
+    } catch (ex) {}
+
 #ifdef XP_WIN
     let shell = new WinNativeApp(aData);
 #elifdef XP_MACOSX
     let shell = new MacNativeApp(aData);
 #else
     return false;
 #endif