From eff0281dfe29da1586aefb6aa74e70433b132f62 Mon Sep 17 00:00:00 2001 From: "shliang%netscape.com" Date: Fri, 7 Mar 2003 02:20:13 +0000 Subject: [PATCH] 192755 - unable to allow popup from site with specified port. r=bzbarsky, sr=jag --- xpfe/communicator/resources/content/popupManager.js | 4 +++- xpfe/components/permissions/content/permissionsManager.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xpfe/communicator/resources/content/popupManager.js b/xpfe/communicator/resources/content/popupManager.js index 28d31bd3175a..49b71d6dc6fc 100644 --- a/xpfe/communicator/resources/content/popupManager.js +++ b/xpfe/communicator/resources/content/popupManager.js @@ -350,7 +350,7 @@ function addPermission() { var host = addSiteBox.value; if (host != "") { - host = host.replace(/^\s*([-\w]*:\/*)?/, ""); // trim any leading space and scheme + host = host.replace(/^\s*([-\w]*:\/+)?/, ""); // trim any leading space and scheme var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); @@ -368,6 +368,8 @@ function addPermission() { return; } + host = uri.hostPort; + if (!host) { addSiteBox.value = ""; return; diff --git a/xpfe/components/permissions/content/permissionsManager.js b/xpfe/components/permissions/content/permissionsManager.js index 28d31bd3175a..49b71d6dc6fc 100644 --- a/xpfe/components/permissions/content/permissionsManager.js +++ b/xpfe/components/permissions/content/permissionsManager.js @@ -350,7 +350,7 @@ function addPermission() { var host = addSiteBox.value; if (host != "") { - host = host.replace(/^\s*([-\w]*:\/*)?/, ""); // trim any leading space and scheme + host = host.replace(/^\s*([-\w]*:\/+)?/, ""); // trim any leading space and scheme var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); @@ -368,6 +368,8 @@ function addPermission() { return; } + host = uri.hostPort; + if (!host) { addSiteBox.value = ""; return;