Open pedrozasantaigo opened 3 months ago
In Chrome every print attempt after the first one shows an empty page in the print dialog and logs this to the console:
[Violation] Avoid using document.write(). https://developers.google.com/web/updates/2016/08/removing-document-write
print @ printd.umd.min.js:1
print @ pen.js:55
n @ vue.min.js:6
t @ vue.min.js:6
The beforeprint
and afterprint
events, that where logged for the first attempt, are not logged to the console anymore for the failing print attempts.
i resolved it creating a new instance each print time.
@pedrozasantaigo Surprisingly, creating a new printd
instance seems to be indeed a successful workaround. I applied that workaround as well.
My first guess was that the usage of document.write()
(as used here: /src/index.ts#L110 ) was the actual problem. But I was not able to confirm that with a locally patched version of printd
.
For reference:
Avoid using document.write(). https://developers.google.com/web/updates/2016/08/removing-document-write
Feel free to submit a patch if any.
First printd.print works, but the second time doesn't and after.
v 126.0.6478.127