home *** CD-ROM | disk | FTP | other *** search
-
- var gSiteBox;
-
- // MERC - JCH: To load the global list of blocked pop-ups we get every pageReport
- // array from every browser and collect entries in a new array called
- // newPageReport[].
- function onLoad()
- {
- gSiteBox = document.getElementById("siteBox");
-
- // Get all the browsers
- var browsers = opener.gBrowser.browsers;
-
- // If for some weird reason we have a null value silently quit
- if (!browsers) {
- window.close();
- return;
- }
-
- var newPageReport = new Array();
- var newCount = 0;
-
- // Look at the pageReport array of each browser
- for (var i=0; i<browsers.length; i++) {
-
- var tmpPageReport = browsers[i].pageReport;
-
- if (tmpPageReport == null) continue;
-
- var count = 0;
- // Start building an array to hold all the URL strings
- // of the other arrays. Prevent repetition of entries.
- for (var j=0; j<tmpPageReport.length; j++) {
-
- var found = false;
- for (var k=0; k<newPageReport.length; k++) {
- if (newPageReport[k] == tmpPageReport[j]) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- newPageReport[newCount] = tmpPageReport[j]
- newCount++;
- }
- }
- }
-
- if (newCount<1) {
- window.close();
- alert("No pop-ups have been blocked");
- return;
- }
-
- for (var i = 0; i < newPageReport.length; i++) {
- gSiteBox.appendItem(newPageReport[i]);
- }
- // select the first item using a delay, otherwise the listitems
- // don't paint as selected.
- setTimeout(selectFirstItem, 0);
- }
-
- function selectFirstItem()
- {
- gSiteBox.selectedIndex = 0;
- }
-
-
-