firefox addon - Add-on for Submitting File from Clipboard -
is there browser-add-on can create temporary txt file clipboard , populate file submit dialog?
guide firefox:
get data clipboard this: paste data clipboard using document.execcommand("paste"); within firefox extension
now can either create temporary file os.file: https://developer.mozilla.org/en-us/docs/javascript_os.file/os.file_for_the_main_thread
or create object window.createobjecturl
.
then assuming file submit dialog prompted html5 uploader, should set value of html5 dialog box there other ways though too, mozsetdataat, mozsetfilearray etc, search github these keywords shows excellent examples:
- https://github.com/search?l=javascript&q=mozsetdataat&type=code&utf8=%e2%9c%93
- https://github.com/search?l=javascript&q=mozsetfilearray&ref=searchresults&type=code&utf8=%e2%9c%93
you might need use mimetype of application/x-moz-file
not sure. experiement , share solution, , ask along way. fun stuff.
there other smarter ways attach input type=file
, trying other week. interested if else share solutions trick file input element think native file dialog used, maybe using xpcom.
Comments
Post a Comment