Important Notice: We're experiencing email notification issues. If you've posted a question in the community forums recently, please check your profile manually for responses while we're working to fix this.

On Monday the 3rd of March, around 5pm UTC (9am PT) users may experience a brief period of downtime while one of our underlying services is under maintenance.

Kërkoni te Asistenca

Shmangni karremëzime gjoja asistence. S’do t’ju kërkojmë kurrë të bëni një thirrje apo të dërgoni tekst te një numër telefoni, apo të na jepni të dhëna personale. Ju lutemi, raportoni veprimtari të dyshimtë duke përdorur mundësinë “Raportoni Abuzim”.

Mësoni Më Tepër

How to Detect When the Print Dialog is Closed

  • 1 përgjigje
  • 1 e ka hasur këtë problem
  • 14 parje
  • Përgjigjja më e re nga markwarner22

more options

I would like to find a way to detect when the print dialog is closed in Firefox (whether the user clicks "Print" or "Cancel"). My goal is to automatically close the opened tab once the print dialog is dismissed.

Currently, I trigger the print dialog like this: var wdw = window.open(fileUrl, '_blank'); if (!wdw) {

   onError();
   return;

} setTimeout(function () {

   try {
       wdw.print();
   } catch (e) {
       onError();
   }

}, 100); However, I haven't found a reliable way to detect when the print dialog is closed so that I can close the tab accordingly.

In Chrome, I was able to achieve this by monitoring focus events and checking document.activeElement. This allowed me to determine when the print dialog was closed and automatically close the tab afterward. However, this approach does not seem to work in Firefox.

Is there a way to track when the print dialog is dismissed in Firefox?

I would like to find a way to detect when the print dialog is closed in Firefox (whether the user clicks "Print" or "Cancel"). My goal is to automatically close the opened tab once the print dialog is dismissed. Currently, I trigger the print dialog like this: var wdw = window.open(fileUrl, '_blank'); if (!wdw) { onError(); return; } setTimeout(function () { try { wdw.print(); } catch (e) { onError(); } }, 100); However, I haven't found a reliable way to detect when the print dialog is closed so that I can close the tab accordingly. In Chrome, I was able to achieve this by monitoring focus events and checking document.activeElement. This allowed me to determine when the print dialog was closed and automatically close the tab afterward. However, this approach does not seem to work in Firefox. Is there a way to track when the print dialog is dismissed in Firefox?

Krejt Përgjigjet (1)

more options

Beyond the defaults Firefox browser has and what the printer driver give it for print options that would be something a Addon or 3rd party software would have something like that.

E dobishme?

Bëni një pyetje

Duhet të bëni hyrjen te llogaria juaj që t’i përgjigjeni postimeve. Ju lutemi, filloni me një pyetje të re, nëse nuk keni ende një llogari.