Modules.VERSION = '1.0.0';

this.api = {
	onDOMContentLoaded: function(e) {
		// this is the content document of the loaded page.
		var doc = e.originalTarget;
		if(doc instanceof content.HTMLDocument) {
			// is this an inner frame?
			// Find the root document:
			while(doc.defaultView.frameElement) {
				doc = doc.defaultView.frameElement.ownerDocument;
			}
			
			if(doc == document) {
				this.checkPage();
			}
		}
	},
	
	checkPage: function() {
		if(document.documentURI.startsWith(addonUris.development)) {
			var unwrap = XPCNativeWrapper.unwrap(content);
			if(unwrap.enable) {
				unwrap.enable(objPathString);
			}
		}
	}
};

Modules.LOADMODULE = function() {
	DOMContentLoaded.add(api);
	
	api.checkPage();
};

Modules.UNLOADMODULE = function() {
	DOMContentLoaded.remove(api);
};

@@ -16,17 +16,17 @@
  = '1.0.
-0
+1
 ';%0A%0Athis
@@ -448,16 +448,227 @@
 ion() %7B%0A
+%09%09if(document.readyState != 'complete') %7B%0A%09%09%09var waiting = () =%3E %7B%0A%09%09%09%09content.removeEventListener('load', waiting);%0A%09%09%09%09this.checkPage();%0A%09%09%09%7D;%0A%09%09%09content.addEventListener('load', waiting);%0A%09%09%09return;%0A%09%09%7D%0A%09%09%09%09%0A
 %09%09if(doc

update backbone