mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 800854 - Make browser_bug400731.js more robust by registering the DOMContentLoaded handler at the right time; r=gcp
This commit is contained in:
parent
80112a2809
commit
2d22514224
@ -6,8 +6,17 @@ function test() {
|
|||||||
gBrowser.selectedTab = gBrowser.addTab();
|
gBrowser.selectedTab = gBrowser.addTab();
|
||||||
|
|
||||||
// Navigate to malware site. Can't use an onload listener here since
|
// Navigate to malware site. Can't use an onload listener here since
|
||||||
// error pages don't fire onload
|
// error pages don't fire onload. Also can't register the DOMContentLoaded
|
||||||
window.addEventListener("DOMContentLoaded", testMalware, true);
|
// handler here because registering it too soon would mean that we might
|
||||||
|
// get it for about:blank, and not about:blocked.
|
||||||
|
gBrowser.addTabsProgressListener({
|
||||||
|
onLocationChange: function(aTab, aWebProgress, aRequest, aLocation, aFlags) {
|
||||||
|
if (aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) {
|
||||||
|
gBrowser.removeTabsProgressListener(this);
|
||||||
|
window.addEventListener("DOMContentLoaded", testMalware, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
content.location = "http://www.mozilla.org/firefox/its-an-attack.html";
|
content.location = "http://www.mozilla.org/firefox/its-an-attack.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user