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 load event fires if preloading is enabled in google-ima.js #25

Closed kzar closed 11 months ago

kzar commented 11 months ago

Some websites using the google-ima.js script choose to set the enablePreloading[1] option. That should cause[2] the AdsManager.init() method to cause the LOADED AdEvent to fire. If the event doesn't fire, those websites can get stuck waiting forever. Most notably, this broke a Trinity Audio voice narration widget that is used on some news websites.

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