1

Autoplay sound is getting stopped as soon as I'm opening a print window through window.print() and coming back after clicking on cancel. This issue is happening only in Chrome browser whereas in Firefox it is working fine. I don't see any error/interrupt as well when I click on print window.

Can someone please explain why this is happening in Chrome and what is the workaround?


I've found the reasoning behind this behaviour. window.print() is a blocking function which blocks all the threads in Chrome but this is not the case with Firefox.

Reproduced this issue here: https://jsfiddle.net/Jatin46/yf0jt8ch/5/

We can see from the above example that time is getting stopped in Chrome but it is running in Firefox since Chrome blocks everything.

Now, I want to know if there is any workaround possible to unblock the background thread?

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Jatin Bansal
  • 171
  • 2
  • 10

0 Answers0