More improvements to the google-ima shim script #3908
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have enabled the google-ima shim script again in the DuckDuckGo
Privacy Essentials browser extension, and found a couple more issues:
cause[2] the AdsManager.init() method to trigger the LOADED AdEvent
to fire. If the event doesn't fire, those websites can get stuck
waiting for the event forever.
dispatched in order, to simulate ads loading, playing and
finishing. There was a mistake in that logic though. The
CONTENT_PAUSE_REQUESTED and CONTENT_RESUME_REQUESTED events[3]
should fire as the ads start and finish respectively. By firing the
latter early, and skipping the former, some websites got confused
and tried to display ad overlays at the same time as playing their
content, or didn't display they content at all.
1 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdsRenderingSettings#enablePreloading
2 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/preload#timing
3 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdEvent