Browse Source

b=600518, r=mfinkle, App window is not activated when protocol callback is invoked

matthew.gertner@gmail.com 14 years ago
parent
commit
ec479a6ada
1 changed files with 8 additions and 9 deletions
  1. 8 9
      components/src/nsCommandLineHandler.js

+ 8 - 9
components/src/nsCommandLineHandler.js

@@ -188,19 +188,10 @@ WebRunnerCommandLineHandler.prototype = {
 
     var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
 
-    if (callback.value) {
-      // Invoke the callback and don't load a new page
-      callback.value.handleURI(url);
-
-      aCmdLine.preventDefault = true;
-      return;
-    }
-
     if (url) {
       var uriFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup);
       newURI = uriFixup.createFixupURI(url, Ci.nsIURIFixup.FIXUP_FLAG_NONE);
 
-
       var win;
       // Check if a window exists with the given url
       var enumerator = wm.getEnumerator("navigator:browser");  
@@ -220,6 +211,14 @@ WebRunnerCommandLineHandler.prototype = {
     
     this.activateWindow(win);
     
+    if (callback.value) {
+      // Invoke the callback and don't load a new page
+      callback.value.handleURI(url);
+
+      aCmdLine.preventDefault = true;
+      return;
+    }
+
     if (url) {
       WebAppProperties.uri = url;
     }