crabbly / Print.js

A tiny javascript library to help printing from the web.
MIT License
4.32k stars 674 forks source link

issue/#528-safari-blank-page #588

Closed aluppol closed 2 years ago

aluppol commented 3 years ago

https://github.com/crabbly/Print.js/issues/528#issuecomment-832661451

violuke commented 2 years ago

Any chance this can be merged? We would really benefit from this. Thank you.

mstroming commented 2 years ago

Yes please to this fix.

wilkosz commented 2 years ago

Any update on this PR?

pgtaboada commented 2 years ago

Running into same problem here...

daphnesmit commented 2 years ago

This is a safari issue its not a print-js issue

spacejamjim commented 2 years ago

I have forked this and implemented the PR and it works great. Can we get this merged with a new minor release, please.

GeoMarkou commented 2 years ago

I just tested it and Google Chrome on Windows passes the isSafari check - so this would also affect Chrome.

// At least Safari 3+: "[object HTMLElementConstructor]"
isSafari: () => {
  return Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0 ||
      navigator.userAgent.toLowerCase().indexOf('safari') !== -1
}
antoniotorres commented 2 years ago

I confirm that this fixes our problem with Safari printing blank page. We are now are able to print a PDF.

Aarbel commented 2 years ago

@antoniotorres any help here ?

dveldhoen commented 2 years ago

This doesn't fix it the problem.

Reproduce: MacOS: 12.2.1 Safari: 15.3 (17612.4.9.1.8) Type: Print from URL

  1. Print PDF
  2. Click cancel in Safari browser
  3. Print again (pop up appears)
  4. PDF is blank