duckduckgo / tracker-surrogates

💉 Surrogates are small scripts that our apps and extensions serve in place of trackers that cause site breakage when blocked.
Other
20 stars 11 forks source link

Ensure google-ima.js surrogate fires content pause/resume events correctly #26

Closed kzar closed 11 months ago

kzar commented 11 months ago

The google-ima.js surrogate should fire the correct events when AdManager.start() is called, to emulate the ads playing and finishing. It's also important that these events[1] are fired in the right order. CONTENT_PAUSE_REQUESTED should fire around when the ads are starting, and CONTENT_RESUME_REQUESTED around when the ads have finished. Correcting this ordering fixes website that use the Video.js the integration of IMA, for example metro.co.uk.

1 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdEvent