I worked through some of the websites listed in the uBlock issue[1]
for the google-ima.js surrogate script, to see what was going wrong:
It turns out the addEventListener method supports an optional
context Object, which is bound to the listener if provided. Some
websites make use of that, and then break when this is not
bound correctly when events are dispatched.
The AdError.prototype.getInnerError()[2] method should return null
or an Error Object, but was returning undefined. This broke
websites that explicitly checked for null.
I worked through some of the websites listed in the uBlock issue[1] for the google-ima.js surrogate script, to see what was going wrong:
this
is not bound correctly when events are dispatched.1 - https://github.com/uBlockOrigin/uBlock-issues/issues/2265 2 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdError#getInnerError