Skip to content

Commit

Permalink
Handle removal of nsIDOMWindow QI
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaply committed Jan 9, 2020
1 parent 3d7866e commit 8e8d482
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cck2/modules/CCK2.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ function updatePermissions(permissions) {
var documentObserver = {
observe: function observe(subject, topic, data) {
if (subject instanceof Ci.nsIDOMWindow) {
var win = subject.QueryInterface(Components.interfaces.nsIDOMWindow);
var win = subject;
if (topic == "chrome-document-global-created" ||
(topic == "content-document-global-created" && win.document.documentURIObject.scheme == "about")) {
win.addEventListener("load", function onLoad(event) {
Expand Down
2 changes: 1 addition & 1 deletion cck2/modules/CCK2AboutAddonsOverlay.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var observer = {
observe: function observe(subject, topic, data) {
switch (topic) {
case "chrome-document-global-created":
var win = subject.QueryInterface(Components.interfaces.nsIDOMWindow);
var win = subject;
win.addEventListener("load", function onLoad(event) {
win.removeEventListener("load", onLoad, false);
var doc = event.target;
Expand Down
2 changes: 1 addition & 1 deletion cck2/modules/CCK2AboutDialogOverlay.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var observer = {
observe: function observe(subject, topic, data) {
switch (topic) {
case "chrome-document-global-created":
var win = subject.QueryInterface(Components.interfaces.nsIDOMWindow);
var win = subject;
win.addEventListener("load", function onLoad(event) {
win.removeEventListener("load", onLoad, false);
var doc = event.target;
Expand Down
2 changes: 1 addition & 1 deletion cck2/modules/CCK2AboutHomeFramescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var observer = {
observe: function observe(subject, topic, data) {
switch (topic) {
case "content-document-global-created":
var win = subject.QueryInterface(Components.interfaces.nsIDOMWindow);
var win = subject;
win.addEventListener("load", function onLoad(event) {
win.removeEventListener("load", onLoad, false);
var doc = event.target;
Expand Down
2 changes: 1 addition & 1 deletion cck2/modules/CCK2AboutSupportOverlay.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var observer = {
observe: function observe(subject, topic, data) {
switch (topic) {
case "chrome-document-global-created":
var win = subject.QueryInterface(Components.interfaces.nsIDOMWindow);
var win = subject;
win.addEventListener("load", function onLoad(event) {
win.removeEventListener("load", onLoad, false);
var doc = event.target;
Expand Down
2 changes: 1 addition & 1 deletion cck2/modules/CCK2BrowserOverlay.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var observer = {
observe: function observe(subject, topic, data) {
switch (topic) {
case "chrome-document-global-created":
var win = subject.QueryInterface(Components.interfaces.nsIDOMWindow);
var win = subject;
win.addEventListener("load", function onLoad(event) {
win.removeEventListener("load", onLoad, false);
var doc = event.target;
Expand Down
2 changes: 1 addition & 1 deletion cck2/modules/CCK2PreferencesOverlay.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var observer = {
observe: function observe(subject, topic, data) {
switch (topic) {
case "chrome-document-global-created":
var win = subject.QueryInterface(Components.interfaces.nsIDOMWindow);
var win = subject;
win.addEventListener("load", function onLoad(event) {
win.removeEventListener("load", onLoad, false);
var doc = event.target;
Expand Down

0 comments on commit 8e8d482

Please sign in to comment.