Index: popup.js |
=================================================================== |
--- a/popup.js |
+++ b/popup.js |
@@ -23,6 +23,7 @@ |
var Prefs = require("prefs").Prefs; |
var checkWhitelisted = require("whitelisting").checkWhitelisted; |
var getDecodedHostname = require("url").getDecodedHostname; |
+var port = require("messaging").port; |
var page = null; |
@@ -57,7 +58,7 @@ |
}); |
// Attach event listeners |
- ext.onMessage.addListener(onMessage); |
+ port.on("composer.ready", onComposerReady); |
document.getElementById("enabled").addEventListener("click", toggleEnabled, false); |
document.getElementById("clickhide").addEventListener("click", activateClickHide, false); |
document.getElementById("clickhide-cancel").addEventListener("click", cancelClickHide, false); |
@@ -79,12 +80,12 @@ |
function onUnload() |
{ |
- ext.onMessage.removeListener(onMessage); |
+ port.off("composer.ready", onComposerReady); |
} |
-function onMessage(message, sender, callback) |
+function onComposerReady(message, sender) |
{ |
- if (message.type == "composer.ready" && sender.page.id == page.id) |
+ if (sender.page.id == page.id) |
document.body.classList.remove("nohtml"); |
} |