mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 917610 - Fix backgroundPageThumbsContent.js's use of nsIDOMWindowUtils.preventFurtherDialogs. r=markh
This commit is contained in:
parent
122bb761d8
commit
bc73d515b4
@ -13,12 +13,7 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
const backgroundPageThumbsContent = {
|
||||
|
||||
init: function () {
|
||||
// Arrange to prevent (most) popup dialogs for this window - popups done
|
||||
// in the parent (eg, auth) aren't prevented, but alert() etc are.
|
||||
let dwu = content.
|
||||
QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils);
|
||||
dwu.preventFurtherDialogs();
|
||||
Services.obs.addObserver(this, "document-element-inserted", true);
|
||||
|
||||
// We want a low network priority for this service - lower than b/g tabs
|
||||
// etc - so set it to the lowest priority available.
|
||||
@ -43,6 +38,19 @@ const backgroundPageThumbsContent = {
|
||||
addProgressListener(this, Ci.nsIWebProgress.NOTIFY_STATE_WINDOW);
|
||||
},
|
||||
|
||||
observe: function (subj, topic, data) {
|
||||
// Arrange to prevent (most) popup dialogs for this window - popups done
|
||||
// in the parent (eg, auth) aren't prevented, but alert() etc are.
|
||||
// preventFurtherDialogs only works on the current inner window, so it has
|
||||
// to be called every page load, but before scripts run.
|
||||
if (subj == content.document) {
|
||||
content.
|
||||
QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils).
|
||||
preventFurtherDialogs();
|
||||
}
|
||||
},
|
||||
|
||||
get _webNav() {
|
||||
return docShell.QueryInterface(Ci.nsIWebNavigation);
|
||||
},
|
||||
@ -102,6 +110,7 @@ const backgroundPageThumbsContent = {
|
||||
QueryInterface: XPCOMUtils.generateQI([
|
||||
Ci.nsIWebProgressListener,
|
||||
Ci.nsISupportsWeakReference,
|
||||
Ci.nsIObserver,
|
||||
]),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user