141
rated 0 times
[
144]
[
3]
/ answers: 1 / hits: 129001
/ 11 Years ago, thu, october 31, 2013, 12:00:00
I'm writing a simple addon in Firefox - 24, on Linux.
I get the error:
ReferenceError: TextEncoder is not defined
when I do: var encoder = new TextEncoder();
the function I'm using is:
function write_text(filename, text) {
var encoder = new TextEncoder();
var data = encoder.encode(text);
Task.spawn(function() {
let pfh = OS.File.open(/tmp/foo, {append: true});
yield pfh.write(text);
yield pfh.flush();
yield pfh.close();
});
}
More From » firefox-addon