Hello Firefox Addon SDK experts,
I'm pretty badly stuck with the following issue.
From my content script, I need to draw a UI using a set of HTML files and image files that are stored under my add-on's Data directory.
I fetch the file URLs in main.js using self.data.url and pass the URLs to content script using port.emit. The URLs are successfully received by the content script.
When I log URL of data/html/myfile.html in content script, it looks like this: resource://jid1-veokemuf24jrmw-at-jetpack/myaddon/data/html/myfile.html
The problem is that nothing seems to happen when I append the element in the document like this:
var a = this;
a.el = $("<div />").attr("id", "topbar");
$("body").append(a.el);
$("#topbar").load(html_url, function() {});
But if I copy-paste the html code from the file to the content script then it works.
Also, if I paste the html file URL to the Firefox's address field it's opened ok.
Is there some fundamental thing why my solution can't work? Or maybe, do I need to define some permission for my add-on to make files under Data directory to be accessible from content script?
All help is highly appreciated.