Hello everyone i have an question about firefox add-on:
How i can get the body content from a tab, for example.
var content = require(\"tabs\").activ
The Add-on SDK doesn't allow direct access to the tab contents - the idea is that the add-on and the tab might end up living in different processes eventually. What you do is injecting a content script into the tab to get you the necessary data, something like this:
var tab = require("tabs").activeTab;
tab.attach({
contentScript: "self.postMessage(document.body.innerHTML);",
onMessage: function(data)
{
console.log("Tab data received: " + data);
}
});