-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print issue on iPad in Google Chrome and Firefox (Safari works) #152
Comments
When |
I changed debug to false, and nothing changed. Safari on iPad opens the print dialog, Google Chrome on iPad doesn't. |
I also tested to print the desired container with DoersGuild/jQuery.print - same behavior. Safari opens the print dialog, Google Chrome doesn't. (on iPad Pro) |
I've researched this somewhat, and the answer isn't good. Non-Safari browsers on iOS do not support the programmatic You can test this with this basic JSFiddle: https://jsfiddle.net/_sir/jxr7uex6/ This appears to have always been the case. These browsers would require a manual print action to be performed. |
It's true - in your fiddle the window.print is not executed in Chrome on iPad. |
I made a test page with our framework bundle. It executes window.print, and that works in Chrome on iPad. http://www.online.holter.at/ho/js/testprint.html The script included in this test file was written in TypeScript and compiled to ES5 JavaScript with AMD module definitions, using RequireJS. |
I currently try to find the issue on my own, and here's how far I've come: document.queryCommandSupported("print") returns true, as well as queryCommandEnabled. That's why it executes line 247 execCommand("print"), but that obviously doesn't execute properly. Working:
Not working:
If you wanna try to use the return value of .execCommand("print") to determine if the print dialog was correctly opened: forget it. It even returns true when no print dialog shows up. |
Also interesting: |
@patrickhrastnik that's not good news. In the interim/short-term, the ugly hack for MSIE would potentially work everywhere. We'll need to do some research on our side to determine the scale of this issue and figure out a viable approach. Thanks for your research. |
Spitballing: I wonder if a |
Interesting thread: https://stackoverflow.com/a/21336448/335514 for additional research |
@patrickhrastnik - take a look at this line from another printing plugin:
If that works, that means we can change a few things around line 246. This might work - worth testing, and then if it does, we can rework that entire section.
|
Thank you for the suggestion @jasonday |
@jasonday I tried if These commands work on desktop device, but not on the iPad Pro:
|
@jasonday Is there something more I can do here? Something I can check out or try? Or some information I could try to get? |
Let me do some digging today and come up with a couple of tests. I appreciate your help in this. |
Any updates? I am having the same issue on an iPhone X and iPad. |
Is this bug is also related to this issue? |
Are there any updates to this issue for Chrome on iPad? This is literally the only issue for me for this great work! |
So, one immediate hack would be to change these lines (https://github.com/jasonday/printThis/blob/master/printThis.js#L278):
to:
It's an ugly hack we utilize for IE, but it may work for this scenario and should work for all scenarios until we figure this out permanently. |
I try it out when I get to my computer today! |
@jasonday Did this ever get resolved? Any updates? |
Implements fix suggested here: jasonday#152 (comment)
@jasonday does it work for you on iPad? |
Thanks for the suggestion @guptanisha edit: maybe I need to give a bit more explanation - due to the current ongoing pandemic I don't have access to my office equipment. That's why I can't give any information on when I'll get a chance to try out the suggested fix. |
Having this issue on Chrome iPad too. Safari works fine. |
I think this is similar to the issue in #193 I believe what's happening in each scenario is that the print iframe is being removed before the print executes. On "desktop", javascript halts execution when the print dialog is open, but chrome on iPad the javascript execution events seem to not halt in the expected manner. I think the quick fix for this is to comment out
Can someone please attempt that fix and report back? |
This was the solution I needed. Thank you |
@patrickhrastnik It doesn't work for me either. It's been 2 yrs almost. Still couldn't resolve the issue. |
Any updates regarding a fix for this issue? |
Description of issue:
When the button meant to start a print dialog is clicked, neither Chrome nor Firefox open a print dialog on an iPad.
Tested with iPad 3G, iPad Air 2 and iPad Pro
Safari opens the dedicated print dialog, so the function basically works.
All browsers execute window.print correctly
====================================================================
Code & options:
The text was updated successfully, but these errors were encountered: