From eda4a735f0ef75ccdf12fa82f0f94a74ce9ecaaf Mon Sep 17 00:00:00 2001 From: "jaggernaut%netscape.com" Date: Tue, 22 Oct 2002 19:48:59 +0000 Subject: [PATCH] Bug 172716: Fix composer Browse button. r=cmanske, sr=dveditz, a=drivers --- editor/ui/composer/content/ComposerCommands.js | 5 +++-- xpfe/browser/resources/content/navigator.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/editor/ui/composer/content/ComposerCommands.js b/editor/ui/composer/content/ComposerCommands.js index 4a99e2c8dd0a..ef0be6cf3172 100644 --- a/editor/ui/composer/content/ComposerCommands.js +++ b/editor/ui/composer/content/ComposerCommands.js @@ -2353,10 +2353,11 @@ var nsPreviewCommand = var windowManagerInterface = windowManager.QueryInterface(Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator("navigator:browser"); + var documentURI = GetDocumentUrl(); while ( enumerator.hasMoreElements() ) { browser = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); - if ( browser && (window._content.location.href == browser._content.location.href)) + if ( browser && (documentURI == browser.getBrowser().currentURI.spec)) break; browser = null; @@ -2367,7 +2368,7 @@ var nsPreviewCommand = // If none found, open a new browser if (!browser) { - browser = window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", window._content.location); + browser = window.openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", documentURI); } else { diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index f78d88364f07..a95bb4f1cbab 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -497,8 +497,8 @@ function Startup() // Check for window.arguments[0]. If present, use that for uriToLoad. if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0]) { - var uriArray = window.arguments[0].split('\n'); - uriToLoad = uriArray.splice(0, 1); + var uriArray = window.arguments[0].toString().split('\n'); // stringify and split + uriToLoad = uriArray.splice(0, 1)[0]; if (uriArray.length > 0) window.setTimeout(function(arg) { for (var i in arg) gBrowser.addTab(arg[i]); }, 0, uriArray); }