Skip to content

Fix: Fixes print preview dialog, closing of printing dialog timeout and fetching of URLs - #227

Merged
RDMillen merged 2 commits into
KovaMD:mainfrom
florian-hubertSE:bugfix/printing-dialog
Aug 13, 2026
Merged

Fix: Fixes print preview dialog, closing of printing dialog timeout and fetching of URLs#227
RDMillen merged 2 commits into
KovaMD:mainfrom
florian-hubertSE:bugfix/printing-dialog

Conversation

@florian-hubertSE

Copy link
Copy Markdown
Contributor

Fixes

  • Print preview dialog
  • Timeout after printing was cancelled (otherwise it was stuck at "Preparing Print...")
  • Sets empty pixel, if an URL for an image couldn't get retrieved while preparing a print preview (or export PDF etc)

@RDMillen RDMillen self-assigned this Aug 12, 2026
@RDMillen RDMillen added the bug Something isn't working label Aug 12, 2026
@RDMillen

Copy link
Copy Markdown
Collaborator

Hi @florian-hubertSE,

Thanks for this, the image placeholder/error handler fix for html-to-image is a solid fix for the broken URL capture failures.

A couple of things worth addressing before merge:

  1. The 5 second fallback timer starts as soon as the promise executor runs, before the iframe's images have loaded and before print() is even called. That budget then has to cover image decoding plus however long the user takes interacting with the native print dialog, which is often more than 5 seconds. Could you move the timer so it only starts once iwin.print() actually runs?
  2. Related to the above, triggerPrint() has no guard against cleanupScheduled, so if the fallback fires first, a later checkAllLoaded() can still call iwin.print() on an iframe that's already been removed from the DOM.
  3. Is 5 seconds long enough in practice for a real print dialog interaction? The old 120s was too generous for the cancelled case, but this feels like it could cut off legitimate prints for anyone who doesn't confirm immediately. Might be worth a focus-based approach to detect the dialog closing rather than a blind timeout.

Thanks,
Ross

@florian-hubertSE

Copy link
Copy Markdown
Contributor Author

Hi @RDMillen,

thanks for your feedback!

I have adjusted to start the fallback timeout after the executor, changed it to 60s, and have changed it to a focus based approach.
I have tested locally on windows, but on MacOS and Linux the focus based approach may differ.

Best regards,
Florian

@RDMillen

Copy link
Copy Markdown
Collaborator

Hi @florian-hubertSE,

Thank you for these changes, I'll pull them down on my MacOS and Linux machines for testing today. Hoping to get a small patch out later in the day.

Ross

@RDMillen

Copy link
Copy Markdown
Collaborator

Hi @florian-hubertSE,

Thank you for the changes - triggers correctly on Linux. Merging.

Ross

@RDMillen
RDMillen merged commit 72b8337 into KovaMD:main Aug 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants