I have a problem in developing firefox addon. I have a binary file in standard data/ dir. How can I get its contents (byte string) in main.js? I've tried a lot but no success. Thank you.
Well finally I got some progress:
var url = self.data.url("img.png")
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);
xhr.overrideMimeType("application/octet-stream")
xhr.send();
console.log(xhr.response.lenght) //4325
But lenght != img.png! Why? Actually img.png size = 4552 bytes...