diff -Nru prism-1.0b4+svn20100601r68118/debian/changelog prism-1.0b4+svn20100623r69375/debian/changelog --- prism-1.0b4+svn20100601r68118/debian/changelog 2010-06-24 05:13:31.000000000 +0100 +++ prism-1.0b4+svn20100623r69375/debian/changelog 2010-06-24 05:13:31.000000000 +0100 @@ -1,8 +1,8 @@ -prism (1.0b4+svn20100601r68118-0ubuntu1~umd1~lucid) lucid; urgency=low +prism (1.0b4+svn20100623r69375-0ubuntu1~umd1~lucid) lucid; urgency=low * New upstream snapshot - -- Fabien Tassin Wed, 02 Jun 2010 05:00:31 +0200 + -- Fabien Tassin Thu, 24 Jun 2010 05:01:04 +0200 prism (1.0b3+svn20100210r62050-0ubuntu1) lucid; urgency=low diff -Nru prism-1.0b4+svn20100601r68118/debian/control prism-1.0b4+svn20100623r69375/debian/control --- prism-1.0b4+svn20100601r68118/debian/control 2010-06-24 05:13:31.000000000 +0100 +++ prism-1.0b4+svn20100623r69375/debian/control 2010-06-24 05:13:31.000000000 +0100 @@ -19,7 +19,7 @@ imagemagick, libasound2-dev, mozilla-devscripts (>= 0.11~), - xulrunner-1.9.2-dev (>= 1.9.2.5~hg20100601r34267+nobinonly-0ubuntu1~umd1~lucid) + xulrunner-1.9.2-dev (>= 1.9.2.6~hg20100624r34348+nobinonly-0ubuntu1~umd1~lucid) Standards-Version: 3.7.3 Package: prism diff -Nru prism-1.0b4+svn20100601r68118/prism/components/src/nsCommandLineHandler.js prism-1.0b4+svn20100623r69375/prism/components/src/nsCommandLineHandler.js --- prism-1.0b4+svn20100601r68118/prism/components/src/nsCommandLineHandler.js 2010-06-02 04:24:18.000000000 +0100 +++ prism-1.0b4+svn20100623r69375/prism/components/src/nsCommandLineHandler.js 2010-06-24 04:29:46.000000000 +0100 @@ -85,6 +85,8 @@ webapp = aCmdLine.handleFlagWithParam("webapp", false); } + var url = aCmdLine.handleFlagWithParam("url", false); + #ifdef XP_MACOSX // On Mac, check for a webapp.ini inside the current app bundle if (!webapp) { @@ -156,7 +158,7 @@ } } } - + if (file && file.exists()) { // Bundles are files and need to be installed if (!file.isDirectory()) { @@ -184,8 +186,6 @@ if (protocolURI && protocolURI.length > 0) { WebAppProperties.uri = protocolURI; } - - var win = this.activateWindow(); if (callback.value) { // Invoke the callback and don't load a new page @@ -195,24 +195,57 @@ return; } + if (!url) { + url = WebAppProperties.uri; + } + + var uriFixup = Cc["@mozilla.org/docshell/urifixup;1"].getService(Ci.nsIURIFixup); + newURI = uriFixup.createFixupURI(url, Ci.nsIURIFixup.FIXUP_FLAG_NONE); + + var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'] + .getService(Components.interfaces.nsIWindowMediator); + + var win; + // Check if a window exists with the given url + var enumerator = windowManager.getEnumerator("navigator:browser"); + while(enumerator.hasMoreElements()) { + var helpwin = enumerator.getNext(); + + if (helpwin.document.getElementById("browser_content").currentURI.spec == newURI.spec) { + win = helpwin; + break; + } + } + + if (!win) { + var windowMediator = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); + win = windowMediator.getMostRecentWindow("navigator:browser"); + + if (win && url) { + var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher); + win = ww.openWindow(win, url, "_blank", null, null); + } + } + + this.activateWindow(win); + // Check for an existing window and reuse it if there is one if (win) { if (protocolURI) { win.document.getElementById("browser_content").loadURI(WebAppProperties.uri, null, null); } - aCmdLine.preventDefault = true; return; } - + else if (url) { + WebAppProperties.uri = url; + } + if (WebAppProperties.script.startup) WebAppProperties.script.startup(); }, - activateWindow : function() { - var windowMediator = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator); - var win = windowMediator.getMostRecentWindow("navigator:browser"); - + activateWindow : function(win) { if (win) { // Make sure it's visible (might have been hidden on close) var xulWindow = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIDocShellTreeItem).treeOwner.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIXULWindow); @@ -222,7 +255,7 @@ event.initEvent("DOMActivate", true, true); win.QueryInterface(Ci.nsIDOMEventTarget).dispatchEvent(event); } - + return win; },