Bug 270098 In <navigator.js>, "Error: browser.popupUrls has no properties"

p=me r=bugs4hj sr=neil.parkwaycc.co.uk
This commit is contained in:
bugzilla%arlen.demon.co.uk 2005-01-03 16:27:12 +00:00
Родитель f7b753a0bd
Коммит b698a85b57
2 изменённых файлов: 15 добавлений и 19 удалений

Просмотреть файл

@ -595,9 +595,14 @@ function Startup()
if (/^\s*$/.test(uriToLoad)) if (/^\s*$/.test(uriToLoad))
uriToLoad = "about:blank"; uriToLoad = "about:blank";
var browser = getBrowser();
browser.popupDomain = null;
browser.popupUrls = [];
browser.popupFeatures = [];
if (uriToLoad != "about:blank") { if (uriToLoad != "about:blank") {
gURLBar.value = uriToLoad; gURLBar.value = uriToLoad;
getBrowser().userTypedValue = uriToLoad; browser.userTypedValue = uriToLoad;
if ("arguments" in window && window.arguments.length >= 3) { if ("arguments" in window && window.arguments.length >= 3) {
loadURI(uriToLoad, window.arguments[2]); loadURI(uriToLoad, window.arguments[2]);
} else { } else {
@ -2271,10 +2276,6 @@ function onPopupBlocked(aEvent) {
var popupIcon = document.getElementById("popupIcon"); var popupIcon = document.getElementById("popupIcon");
popupIcon.hidden = false; popupIcon.hidden = false;
} }
if (!browser.popupUrls) {
browser.popupUrls = [];
browser.popupFeatures = [];
}
// Check for duplicates, remove the old occurence of this url, // Check for duplicates, remove the old occurence of this url,
// to update the features, and put it at the end of the list. // to update the features, and put it at the end of the list.
for (var i = 0; i < browser.popupUrls.length; ++i) { for (var i = 0; i < browser.popupUrls.length; ++i) {
@ -2318,18 +2319,10 @@ function StatusbarViewPopupManager() {
} }
function popupBlockerMenuShowing(event) { function popupBlockerMenuShowing(event) {
var parent = event.target;
var browser = getBrowser().selectedBrowser;
var separator = document.getElementById("popupMenuSeparator"); var separator = document.getElementById("popupMenuSeparator");
if ("popupDomain" in browser) { if (separator)
createShowPopupsMenu(parent); separator.hidden = !createShowPopupsMenu(event.target);
if (separator)
separator.hidden = false;
} else {
if (separator)
separator.hidden = true;
}
} }
function createShowPopupsMenu(parent) { function createShowPopupsMenu(parent) {
@ -2338,6 +2331,9 @@ function createShowPopupsMenu(parent) {
var browser = getBrowser().selectedBrowser; var browser = getBrowser().selectedBrowser;
if (browser.popupUrls.length == 0)
return false;
for (var i = 0; i < browser.popupUrls.length; i++) { for (var i = 0; i < browser.popupUrls.length; i++) {
var menuitem = document.createElement("menuitem"); var menuitem = document.createElement("menuitem");
menuitem.setAttribute("label", gNavigatorBundle.getFormattedString('popupMenuShow', [browser.popupUrls[i].spec])); menuitem.setAttribute("label", gNavigatorBundle.getFormattedString('popupMenuShow', [browser.popupUrls[i].spec]));

Просмотреть файл

@ -331,8 +331,8 @@ nsBrowserStatusHandler.prototype =
if (blank || if (blank ||
!("popupDomain" in browser)) { !("popupDomain" in browser)) {
browser.popupDomain = null; browser.popupDomain = null;
browser.popupUrls = null; browser.popupUrls = [];
browser.popupFeatures = null; browser.popupFeatures = [];
} }
else { else {
var hostPort = ""; var hostPort = "";
@ -342,8 +342,8 @@ nsBrowserStatusHandler.prototype =
catch(ex) { } catch(ex) { }
if (hostPort != browser.popupDomain) { if (hostPort != browser.popupDomain) {
browser.popupDomain = null; browser.popupDomain = null;
browser.popupUrls = null; browser.popupUrls = [];
browser.popupFeatures = null; browser.popupFeatures = [];
} }
} }