Bug 766546 - Ignore the iframe's load event and continue when the whole page has loaded. r=avih

This commit is contained in:
Tim Taubert 2013-07-24 17:58:05 +02:00
parent fc50664f28
commit aa33cd1986
2 changed files with 9 additions and 13 deletions

View File

@ -123,6 +123,7 @@ MOCHITEST_BROWSER_FILES = \
browser_bug556061.js \
browser_bug559991.js \
browser_bug561623.js \
browser_bug561636.js \
browser_bug562649.js \
browser_bug563588.js \
browser_bug565575.js \
@ -352,13 +353,6 @@ MOCHITEST_BROWSER_FILES += \
$(NULL)
endif
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
# Bug 766546.
MOCHITEST_BROWSER_FILES += \
browser_bug561636.js \
$(NULL)
endif
ifdef MOZ_DATA_REPORTING
MOCHITEST_BROWSER_FILES += \
browser_datareporting_notification.js \

View File

@ -374,13 +374,15 @@ function()
Services.obs.addObserver(gObserver, "invalidformsubmit", false);
tab.linkedBrowser.addEventListener("load", function(e) {
let browser = e.currentTarget;
browser.removeEventListener("load", arguments.callee, true);
// Ignore load events from the iframe.
if (tab.linkedBrowser.contentDocument == e.target) {
let browser = e.currentTarget;
browser.removeEventListener("load", arguments.callee, true);
isnot(gBrowser.selectedTab.linkedBrowser, browser,
"This tab should have been loaded in background");
Services.console.logStringMessage("About to click #s on URI: " + browser.contentDocument.location.href);
browser.contentDocument.getElementById('s').click();
isnot(gBrowser.selectedTab.linkedBrowser, browser,
"This tab should have been loaded in background");
browser.contentDocument.getElementById('s').click();
}
}, true);
tab.linkedBrowser.loadURI(uri);