Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
Switching fullscreen triggers a "visibilitychange" event on safari

On Safari (15.3) on Macos (11.6.4), and possibly on ios too, enabling and disabling fullscreen triggers a "visibilitychange" event. It doesn't on Chrome and Firefox.

Is there a simple way to fix that (to not trigger the visibilitychange on safari)?
A solution would be disabling and enabling the visibilitychange listener when switching fullscreen, but it's quite hacky.

Some snippets to reproduce :

document.addEventListener('visibilitychange', () => {console.log('visibilitychange')}, false);
document.addEventListener('webkitvisibilitychange', () => {console.log('webkitvisibilitychange')}, false);
 

var elem = document.getElementById("myvideo");
function openFullscreen() {
  if (elem.requestFullscreen) {
    elem.requestFullscreen();
  } else if (elem.webkitRequestFullscreen) { /* Safari */
    elem.webkitRequestFullscreen();
  } else if (elem.msRequestFullscreen) { /* IE11 */
    elem.msRequestFullscreen();
  }
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!