18

The Page Visibility API starts to be commonly used to pause mandatory video advertisements when the tab is not in focus.

This means you need to be watching the ad, if you switch tab or even have another app or menu covering the browser the ad will pause and prevent access to the content.

It is extremely annoying but I couldn't find a way to circumvent this.

Is there any way to disable this API using the Chrome or Firefox extension APIs, so that, for instance, one could do something else while the ad is playing?

aberaud
  • 909
  • 1
  • 11
  • 24

2 Answers2

17

I wrote you an extension that will do just that.

Available here.

I tested it on this page.

Repository here.

Let me know if you have any questions.

Deltik
  • 1,129
  • 7
  • 32
Wyatt
  • 2,491
  • 15
  • 12
  • 1
    Thanks a lot for the answer :) Does the extension still work today (Chrome or Firefox)? If so, could you please explain in the answer how your extension achieved this result? – aberaud May 28 '22 at 20:28
4

If you want a quick way to disable the visibilitychange event once, you can do that with the 'inspect element' menu in your browser.

Steps for Chrome / Edge:

  1. Open the debug window in your browser. (press F12)
  2. Go to the Elements tab.
  3. Select the tag, at the top in the code.
  4. In the styles pane, open the 'Event Listeners' tab.
  5. Here you can remove the 'visibilitychange' event. Now you can switch tabs of minimalize the window and the webpage won't notice it.

Screenshot showing how to remove the visibilitychange-event, in Google Chrome

Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187