javascript - download string object content as plain text file with Mozilla Firefox extension -
in ff extension create object (a string) retrieving info dom.
now need download plain text file string content. result should csv file.
i read adddownload method miss lot of pieces... hint?
mainly don't know how to:
"transform" string in downloadable object (a file?)
correctly phone call adddownload method (nsiuri, etc)
thank much help.
you have number of approaches. old-school way manipulate nsifile , nsifileoutputstream directly, although can't write null bytes way. can create nsistringinputstream string , write output stream, or can utilize nsiasyncstreamcopier re-create asynchronously. fileutils.jsm , netutil.jsm exist seek create easier you.
however, if targetting new plenty versions of firefox, can ignore , utilize os.file api instead.
javascript firefox-addon download
No comments:
Post a Comment