Hi, I have an addon perfectly working just up to FF 47. I know that with e10s FF 48, it has some compatibility troubles. Here a brief list of the lines of code I think are affected by the new multiprocess model of the browser:
1. let { Cc, Ci } = require('chrome');
2. const { Cu } = require("chrome");
3. require("sdk/tabs").on("ready",logURL);
4. Cu.import("resource://gre/modules/FileUtils.jsm");
5. const {TextDecoder, TextEncoder, OS} = Cu.import("resource://gre/modules/osfile.jsm", {});
6. file = FileUtils.getFile("Home", [".cp.txt"]); //reopen the file just saved
7. var txt = "";
var fstream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream);
var cstream = Cc["@mozilla.org/intl/converter-input-stream;1"].createInstance(Ci.nsIConverterInputStream);
fstream.init(file, -1, 0, 0);
cstream.init(fstream, "UTF-8", 0, 0);
let str = {};
let read = 0;
do {
read = cstream.readString(0xffffffff, str); // read as much as we can and put it in str.value
txt += str.value;
} while (read != 0);
cstream.close(); // this closes fstream
// use 0x02 | 0x10 to open file for appending.
// save the domain option in file
foStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
converter.init(foStream, "UTF-8", 0, 0);
var sEP = txt + '\n' + 'h' + '\n'; // encrypt new path
converter.writeString(sEP);
converter.close(); // this closes foStream
console.log('saved h');
}
Please, I need to know, first of all, if all these elements are effectively problematic with new FF, and finally if there is a surrogate construct for the 48 version in order to solve the same problem. In particular, it is essential for the add-on the use of the tabs mechanism. Thanks for the help.