From 24468da0385f7c98d5d3afd371618e02e404f1e1 Mon Sep 17 00:00:00 2001 From: "mnyromyr%tprac.de" Date: Mon, 20 Mar 2006 21:35:11 +0000 Subject: [PATCH] Bug 329959: Dialog Origin Spoofing fix on Mac for SeaMonkey; p=, r=me, sr=Neil --- xpfe/global/resources/content/commonDialog.js | 13 +++++++++++-- xpfe/global/resources/content/commonDialog.xul | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/xpfe/global/resources/content/commonDialog.js b/xpfe/global/resources/content/commonDialog.js index 3fa4a48efd07..ed2df9b1f128 100644 --- a/xpfe/global/resources/content/commonDialog.js +++ b/xpfe/global/resources/content/commonDialog.js @@ -103,8 +103,17 @@ function setLabelForNode(aNode, aLabel, aIsLabelFlag) function commonDialogOnLoad() { - // set the document title - document.title = gCommonDialogParam.GetString(12); + // Set the document title. On Mac, we only care about URI's. + if (/Mac/.test(navigator.platform)) { + var titleString = gCommonDialogParam.GetString(12); + if (/^\w+:\/\/\w/.test(titleString)) { + setElementText("info.title", titleString, true); + unHideElementById("info.title"); // Show URI inside dialog. + } + } + else { + document.title = gCommonDialogParam.GetString(12); + } // set the number of command buttons var nButtons = gCommonDialogParam.GetInt(2); diff --git a/xpfe/global/resources/content/commonDialog.xul b/xpfe/global/resources/content/commonDialog.xul index db12e8d4cc2a..e709cfa47453 100644 --- a/xpfe/global/resources/content/commonDialog.xul +++ b/xpfe/global/resources/content/commonDialog.xul @@ -21,6 +21,8 @@ + +