X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Fcontent%2Fdisable-acr.jsm;fp=common%2Fcontent%2Fdisable-acr.jsm;h=3481cda8bc70755849b15c955ec24a107492caa7;hb=70740024f9c028c1fd63e1a1850ab062ff956054;hp=80b9032f5231ec9faee0de6a41491783ad272577;hpb=718c614c183350706466e22939d0101ca4c87efe;p=dactyl.git diff --git a/common/content/disable-acr.jsm b/common/content/disable-acr.jsm index 80b9032..3481cda 100644 --- a/common/content/disable-acr.jsm +++ b/common/content/disable-acr.jsm @@ -14,16 +14,18 @@ const Cu = Components.utils; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +const TOPIC = "chrome-document-global-created"; + function observe(window, topic, url) { - if (topic === "chrome-document-global-created") + if (topic === TOPIC) checkDocument(window.document); } function init(id) { if (id) ADDON_ID = id; - Services.obs[id ? "addObserver" : "removeObserver"](observe, "chrome-document-global-created", false); - for (let doc in chromeDocuments) + Services.obs[id ? "addObserver" : "removeObserver"](observe, TOPIC, false); + for (let doc in chromeDocuments()) checkDocument(doc, !id); } function cleanup() { init(null); } @@ -55,7 +57,7 @@ function checkDocument(doc, disable, force) { } function chromeDocuments() { - let windows = services.windowMediator.getXULWindowEnumerator(null); + let windows = Services.wm.getXULWindowEnumerator(null); while (windows.hasMoreElements()) { let window = windows.getNext().QueryInterface(Ci.nsIXULWindow); for each (let type in ["typeChrome", "typeContent"]) {