The following browsers are failing on Android. Tested on a simulator and with real devices (Pixel w/ Android 8.0 and Nexus 4 w/Android 5.1.1):
- Running window.print() throws a catchable exception so we can throw an error message
- Feature detecting beforehand does not look possible. I raised an upstream bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1414935#c1)
- Maxthon Browser
- UC Browser
- window.print is available and click handler is bound but doesn't do anything.
- It works on desktop
- setTimeout doesn't help
- No print option in browser menu
- When investigating it was suggested tha window.print might not actually work until the document has fully loaded however when I tried this still didn't work. Even doing an unconditional window.print a window load event has no effect
A MTC to make it easier to identify browsers which programmatic printing is possible is here:
On a large share of browsers clicking the button is a no-op ie. nothing happens.
- Can we feature detect whether calling window.print will do nothing? NO. In some cases we can detect when it's failed though.
- If we decide to browser detect, can we reliably filter out Android versions of Opera, Dolphin etc... What are their user agents?
- We have a list of browsers that we can reliably target on-wiki.
- Document ^ and other updates to mobile PDFs
Per T179529#3738918, we will whitelist Chrome on Android. Doing so will enable us to collect some data around usage before rolling it out to a wider number of devices.