0

My Edge extension creates PDF files. What's is the best approach to provide a download capability for these files in my extension? I tried:

  1. window.navigator.msSaveOrOpenBlob()
  2. create link dynamically and assign data URI to the HREF field
  3. this approach: http://html5-demos.appspot.com/static/a.download.html

None of these ways seem to work. The "Downloads" API is not available at the moment. Using the Flash script to download the file is not the best solution (it requires Flash to be enabled).

Ideal scenario is: user clicks a "Download" button, and a "Save as" dialog appears. So how do I do that in my Edge extension?

Evgeny
  • 26
  • 2
  • re: http://html5-demos.appspot.com/static/a.download.html Why is this not working? What error messages to you get? Are you using the correct mime-type? – Rob Parsons Jun 04 '17 at 19:20
  • it works in browser perfectly, but when you use it in the extension page, you get nothing (no reaction, no error messages). – Evgeny Jun 06 '17 at 06:36
  • it won't (of coarse)... you have to post a message to a method in an injected script link from the onClick method in your background.js. What is the Use Case of your extension...eg. Shopping Coupon Printer... Is there an existing FX or Chrome extension that you are trying to convert to an Edge extension? – Rob Parsons Jun 07 '17 at 07:45
  • Yes, I"m trying to convert FireShot. I'm not sure, if fully I understand you - do you say, that this method will nicely work in the background.js, but not in the script injected into the extension page? Is there any example of it? – Evgeny Jun 08 '17 at 09:02
  • mmm.... Edge already has Web notes built-in.users can also print and annotate a PDF printer output.. I don't have fireshot installed, but there should be a content.js (or similar ) with fireshot that is injecting scripts and/or css into the web page...Perhaps it is just a permissions issue in your manifest file. Without viewing your code we can only make guesses. – Rob Parsons Jun 09 '17 at 22:08

0 Answers0