fix bug 217611: Page Info can be opened multiple times

patch by Jason Barnabe (np) <jason_barnabe@fastmail.fm>, r=mconnor


git-svn-id: svn://10.0.0.236/trunk@180724 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
db48x%yahoo.com 2005-09-21 01:12:29 +00:00
parent dfebeecaff
commit 2141ea793c
4 changed files with 26 additions and 21 deletions

View File

@ -1975,14 +1975,16 @@ function BrowserViewSourceOfURL(url, charset, pageCookie)
url, charset, pageCookie);
}
// doc=null for regular page info, doc=owner document for frame info.
function BrowserPageInfo(doc)
// doc - document to use for source, or null for this window's document
// initialTab - name of the initial tab to display, or null for the first tab
function BrowserPageInfo(doc, initialTab)
{
var args = {doc: doc, initialTab: initialTab};
toOpenDialogByTypeAndUrl("Browser:page-info",
doc ? doc.location : window.content.document.location,
"chrome://browser/content/pageInfo.xul",
"chrome,dialog=no",
doc);
args);
}
#ifdef DEBUG
@ -3770,8 +3772,7 @@ function onViewToolbarCommand(aEvent)
function displaySecurityInfo()
{
window.openDialog("chrome://browser/content/pageInfo.xul", "_blank",
"dialog=no", null, "securityTab");
BrowserPageInfo(null, "securityTab");
}
function nsBrowserContentListener(toplevelWindow, contentWindow)

View File

@ -245,9 +245,11 @@ const XHTMLre = RegExp(XHTMLNSre + "|" + XHTML2NSre, "");
var onLoadRegistry = [ ];
/* Called when PageInfo window is loaded. Arguments are:
* window.arguments[0] - document to use for source (null=Page Info, otherwise Frame Info)
* window.arguments[1] - tab name to display first (may be null)
*/
* window.arguments[0] - (optional) an object consisting of
* - doc: (optional) document to use for source. if not provided,
* the calling window's document will be used
* - initialTab: (optional) id of the inital tab to display
*/
function onLoadPageInfo()
{
//dump("===============================================================================\n");
@ -274,10 +276,11 @@ function onLoadPageInfo()
gStrings.mediaInput = theBundle.getString("mediaInput");
var docTitle = "";
if ("arguments" in window && window.arguments.length >= 1 && window.arguments[0])
if ("arguments" in window && window.arguments.length >= 1 &&
window.arguments[0] && window.arguments[0].doc)
{
theWindow = null;
theDocument = window.arguments[0];
theDocument = window.arguments[0].doc;
docTitle = theBundle.getString("frameInfo.title");
}
else
@ -309,18 +312,13 @@ function onLoadPageInfo()
/* Select the requested tab, if the name is specified */
var tabControl = document.getElementById("tabbox");
if ("arguments" in window && window.arguments.length > 1)
if ("arguments" in window && window.arguments.length >= 1 &&
window.arguments[0] && window.arguments[0].initialTab)
{
var tabName = window.arguments[1];
if (tabName)
var tab = document.getElementById(window.arguments[0].initialTab);
if (tab)
{
var tab = document.getElementById(tabName);
if (tabControl && tab)
{
tabControl.selectedTab = tab;
}
tabControl.selectedTab = tab;
}
}
tabControl.selectedTab.focus();

View File

@ -62,9 +62,15 @@
// Get the window for this information
var w;
#ifdef MOZ_PHOENIX
if (window.arguments[0] && window.arguments[0].doc)
{
w = window.arguments[0].doc;
#else
if ("arguments" in window && window.arguments.length > 0 && window.arguments[0])
{
w = window.arguments[0];
#endif
// We don't have separate info for a frame, return null until further notice
// (see bug 138479)

View File

@ -20,7 +20,7 @@ pippki.jar:
content/pippki/ssl2ciphers.xul (content/ssl2ciphers.xul)
content/pippki/ssl3tlsciphers.xul (content/ssl3tlsciphers.xul)
content/pippki/ssl3tlsciphers2.xul (content/ssl3tlsciphers2.xul)
content/pippki/PageInfoOverlay.xul (content/PageInfoOverlay.xul)
* content/pippki/PageInfoOverlay.xul (content/PageInfoOverlay.xul)
content/pippki/newserver.js (content/newserver.js)
* content/pippki/newserver.xul (content/newserver.xul)
content/pippki/downloadcert.js (content/downloadcert.js)