Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site problem with the new google-ima shim script #2265

Open
mapx- opened this issue Sep 13, 2022 Discussed in #2264 · 10 comments
Open

Site problem with the new google-ima shim script #2265

mapx- opened this issue Sep 13, 2022 Discussed in #2264 · 10 comments
Labels
bug Something isn't working

Comments

@mapx-
Copy link
Contributor

mapx- commented Sep 13, 2022

Discussed in #2264

Originally posted by vlaszlo September 13, 2022
STR (using the most current Firefox nightly, if it matters):

  1. Create a new profile, install 1.44.3b3.
  2. Important: Purge and update filter lists.
  3. On EHF TV, click through 2 or 3 videos, you don't actually have to watch them to the end. Notice they are functioning normally.
  4. Install 1.44.3b4.
  5. Go to EHF TV, try to watch a few videos again. They now either don't load at all, or they play with sound but no picture.

If I interpret the logger right, the google-ima script is blocked with beta3, while it's replaced with the shim in beta4. Allowing the connection to imasdk.googleapis.com makes the videos work normally again in beta4, too.

Now the question: Filter issue (an exception needs to be added) or uBlock issue (the shim script needs to be improved)?

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Nov 13, 2022

Looks like after google-ima script redirection starts to apply in 1.45, more reports of video's breakages appear than I expected.

@gorhill
Copy link
Member

gorhill commented Nov 13, 2022

Ok let's remove the redirect-rule filter. We will try to use the filter only when video breakage is reported when ima3 is blocked (there are many exceptions for this, I though a neutered script would help).

@gorhill
Copy link
Member

gorhill commented Nov 13, 2022

@gorhill
Copy link
Member

gorhill commented Nov 13, 2022

So we will try to fix breakage as a result of blocking ima3 by using the redirect rule, and if this does not work, we will then use an exception filter (as was the case before ima3). When the redirect rule does not work, I will try to find out if the ima3 neutered script can be improved.

@gwarser gwarser added the bug Something isn't working label Nov 13, 2022
@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Feb 9, 2023

@gorhill I'm not sure if google-ima has updated or not. In this case: uBlockOrigin/uAssets#13393 (comment) , when I switched from allowing to redirection via

@@||components2.rcsobjects.it/rcs_adv/v1/distro/dfp/common/prebid$script,domain=oggi.it
@@||imasdk.googleapis.com/js/sdkloader/ima3.js$script,domain=oggi.it,badfilter
||imasdk.googleapis.com/js/sdkloader/ima3.js$script,domain=oggi.it,redirect-rule=google-ima.js

video is still broken and there are errors reported that google.ima.OmidVerificationVendor and t.omidAccessModeRules are undefined. So I set

oggi.it##+js(set, google.ima.OmidVerificationVendor, {})
oggi.it##+js(set, Object.prototype.omidAccessModeRules, {})

then the video works.

The ima script has

w("google.ima.OmidVerificationVendor", {
    COMSCORE: 7,
    DOUBLEVERIFY: 3,
    GOOGLE: 9,
    INTEGRAL_AD_SCIENCE: 4,
    MEETRICS: 8,
    MOAT: 2,
    NIELSEN: 6,
    PIXELATE: 5,
    OTHER: 1,
    7: "COMSCORE",
    3: "DOUBLEVERIFY",
    9: "GOOGLE",
    4: "INTEGRAL_AD_SCIENCE",
    8: "MEETRICS",
    2: "MOAT",
    6: "NIELSEN",
    5: "PIXELATE",
    1: "OTHER"
});

and this.omidAccessModeRules = {};.


Same situation with uBlockOrigin/uAssets#16309

@@||components2.rcsobjects.it/rcs_adv/*/distro/dfp/common/prebid$script,domain=video.gazzetta.it
||imasdk.googleapis.com/js/sdkloader/ima3.js$script,domain=video.gazzetta.it,redirect-rule=google-ima.js
video.gazzetta.it##+js(set, google.ima.OmidVerificationVendor, {})
video.gazzetta.it##+js(set, Object.prototype.omidAccessModeRules, {})

@MasterKia
Copy link
Member

MasterKia commented Apr 1, 2023

When the redirect rule does not work, I will try to find out if the ima3 neutered script can be improved.

@gorhill With:
||imasdk.googleapis.com/js/sdkloader/ima3.js^$redirect-rule=google-ima.js

When clicking on any video here:
https://gem.cbc.ca/push

I get in console:

TypeError: this is undefined
    value NextJS
    _dispatch https://imasdk.googleapis.com/js/sdkloader/ima3.js:323
    requestAds https://imasdk.googleapis.com/js/sdkloader/ima3.js:364
    promise callback*requestAds https://imasdk.googleapis.com/js/sdkloader/ima3.js:361
    NextJS 73
[ima3.js:325:19](https://imasdk.googleapis.com/js/sdkloader/ima3.js)
    _dispatch https://imasdk.googleapis.com/js/sdkloader/ima3.js:325
    requestAds https://imasdk.googleapis.com/js/sdkloader/ima3.js:364
    (Async: promise callback)
    requestAds https://imasdk.googleapis.com/js/sdkloader/ima3.js:361

uBlockOrigin/uAssets#17367

@stephenhawk8054
Copy link
Member

There are 2 sites that need ##+js(set, google.ima.settings.setDisableFlashAds, noopFunc)

uBlockOrigin/uAssets#14656
uBlockOrigin/uAssets#19045

gorhill added a commit to gorhill/uBlock that referenced this issue Jul 16, 2023
@gorhill
Copy link
Member

gorhill commented Jul 16, 2023

https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/history:

3.214.1 | 6/12/2018 | Removes ImaSdkSettings.setDisableFlashAds() and ImaSdkSettings.getDisableFlashAds(). Flash support has been sunset in the HTML5 SDK as of 5/15/18.

gorhill/uBlock@cdf385f

gorhill added a commit to gorhill/uBlock that referenced this issue Jul 16, 2023
@stephenhawk8054
Copy link
Member

Confirm it works 👍

gorhill added a commit to gorhill/uBlock that referenced this issue Oct 7, 2023
kzar added a commit to kzar/tracker-surrogates that referenced this issue Oct 25, 2023
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:

1. It turns out the addEventListener method supports an optional
   context Object, which is bound to the provided listener. Some
   websites make use of that, and then break when `this` is not
   bound correctly when events are dispatched.
2. The AdError.prototype.getInnerError()[] method should return null
   or error, but was returning undefined. This broke websites that
   explicitly checked for null.

1 - uBlockOrigin/uBlock-issues#2265
2 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdError
kzar added a commit to kzar/tracker-surrogates that referenced this issue Oct 25, 2023
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:

1. 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.
2. The AdError.prototype.getInnerError()[2] method should return null
   or error, but was returning undefined. This broke websites that
   explicitly checked for null.

1 - uBlockOrigin/uBlock-issues#2265
2 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdError#getInnerError
kzar added a commit to kzar/tracker-surrogates that referenced this issue Oct 25, 2023
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:

1. 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.
2. 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.

1 - uBlockOrigin/uBlock-issues#2265
2 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdError#getInnerError
kzar added a commit to kzar/uBlock that referenced this issue Oct 25, 2023
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 turned 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.

See also duckduckgo/tracker-surrogates#24

1 - uBlockOrigin/uBlock-issues#2265
kzar added a commit to kzar/uBlock that referenced this issue Oct 25, 2023
I worked through some of the websites listed in the google-ima shim
script issue[1], to see what was going wrong. It turned 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.

See also duckduckgo/tracker-surrogates#24

1 - uBlockOrigin/uBlock-issues#2265
gorhill pushed a commit to gorhill/uBlock that referenced this issue Oct 25, 2023
I worked through some of the websites listed in the google-ima shim
script issue[1], to see what was going wrong. It turned 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.

See also duckduckgo/tracker-surrogates#24

1 - uBlockOrigin/uBlock-issues#2265
dharb pushed a commit to duckduckgo/tracker-surrogates that referenced this issue Oct 26, 2023
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:

1. 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.
2. 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.

1 - uBlockOrigin/uBlock-issues#2265
2 - https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdError#getInnerError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants