With Proton deployed, we will be able to offer browsers other than Chrome the option to download PDFs of articles. Rather than triggering window.print when clicked, the new button will trigger a download of the PDF
Precursors
T179915 will tell us what kind of traffic we can handle. Should be considered a blocker before beginning work on this.
Developer notes for design
- When clicking the icon we probably want to give some feedback to the user as otherwise, it's possible the user may start multiple downloads through multiple clicks. Please think about treatment here. Options include an intermediate screen that explains the feature (e.g. drawer) or a toast (that says download has started)
- Do we want to keep the existing behaviour for Chrome - e.g. trigger print? This has repercussions on whether we work on T162414
- Do we want to continue using the page actions menu icon, or do we want to relocate the icon to another place e.g. bottom of screen/fixed footer menu. We should consider usage compared to features such as language/watch/edit.
Acceptance criteria
- Remove all restrictions to the code and show the button on all browsers. Make sure getChromeVersion and getAndroidVersion functions have been removed as these no longer do anything (Chrome < 41 and Android < 5 no longer get JS from us).
- If window.print === undefined trigger the fallback PDF generation
- try and catch window.print. If an exception is thrown trigger the fallback PDF generation
QA
Confirm that download button shows in Firefox.