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

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

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