The code you have there is mostly correct and works for me. However, there are two questions with your content script:
event.preventDefault(), . , , .- ,
event.target . node .
, script :
window.addEventListener("click", function(event)
{
var link = event.target;
while (link && link.localName != "a")
link = link.parentNode;
if (link)
{
self.port.emit("click", link.href);
event.preventDefault();
}
}, false);
script, , contentScript, data/. contentScriptFile :
contentScriptFile: require("self").data.url("contentScript.js"),