1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-14 17:45:45 +01:00

Add some docs. Yay.

This commit is contained in:
Kris Maglione
2011-06-02 15:04:02 -04:00
parent 8240744263
commit abd00c8350
2 changed files with 175 additions and 18 deletions

View File

@@ -14,15 +14,17 @@ 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);
Services.obs[id ? "addObserver" : "removeObserver"](observe, TOPIC, false);
for (let doc in chromeDocuments())
checkDocument(doc, !id);
}