Skip to content

Add AdRequest.omidAccessModeRules property to google-ima shim#3911

Open
kzar wants to merge 1 commit into
gorhill:masterfrom
kzar:improve-google-ima-shim-again-again
Open

Add AdRequest.omidAccessModeRules property to google-ima shim#3911
kzar wants to merge 1 commit into
gorhill:masterfrom
kzar:improve-google-ima-shim-again-again

Conversation

@kzar

@kzar kzar commented Nov 28, 2023

Copy link
Copy Markdown
Contributor

Add the missing AdRequest.omidAccessModeRules[1] property, to avoid
breaking websites that access it.

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

@kzar

kzar commented Nov 28, 2023

Copy link
Copy Markdown
Contributor Author

@gorhill if you'd like to test this, browse to https://www.corriere.it/video-articoli/2022/07/13/missione-wwf-liberare-mare-plastica/9abb64de-029d-11ed-a0cc-ad3c68cacbae.shtml (making sure google-ima.js is being redirected to the shim) and try playing the video. Without the fix, I found the video wouldn't play and an error showed up in the console about the missing property.

@gorhill

gorhill commented Nov 28, 2023

Copy link
Copy Markdown
Owner

On my side, the video still doesn't play with uBO + default lists + the filter ||imasdk.googleapis.com/js/sdkloader/ima3.js$script,redirect-rule=google-ima.js:10,from=corriere.it and the fix.

What works to unbreak the video on our side is *$script,redirect-rule=noopjs,from=corriere.it for that site, or simply blocking ||imasdk.googleapis.com^ without redirection.

@kzar

kzar commented Nov 28, 2023

Copy link
Copy Markdown
Contributor Author

Dang OK, yea there's quite a lot going on in that website. It's probably not the best test case, but it's the only one I have. In the DuckDuckGo Privacy Essentials extension, this change fixed video playback. But there we are also blocking and redirecting a bunch of other requests. Reproducing the issue to see it being fixed here might be a PITA, sorry :/.

FWIW I am quite confident in the change though, the website attempts to do t.omidAccessModeRules[google.ima.OmidVerificationVendor.OTHER]=google.ima.OmidAccessMode.FULL with t being an AdRequest in 4.min.js. The AdRequest.omidAccessModeRules property is also listed in the docs.

But yea, no pressure if you'd rather not merge. Just wanted to share this back! Sorry I don't have a good test website.

@gorhill

gorhill commented Nov 28, 2023

Copy link
Copy Markdown
Owner

I will investigate more when I get the time to find out where it fails on my side.

@kzar

kzar commented Nov 28, 2023

Copy link
Copy Markdown
Contributor Author

OK cool, sounds good. If it helps, here's a (compressed) HAR file showing which requests the DuckDuckGo extension redirected/blocked/allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants