uBlockOrigin / uAssets

Resources for uBlock Origin, uMatrix: static filter lists, ready-to-use rulesets, etc.
GNU General Public License v3.0
4.16k stars 772 forks source link

worldsurfleague.com: breakage #25014

Closed Sharkinator1198 closed 2 months ago

Sharkinator1198 commented 2 months ago

Prerequisites

URL address of the web page

https://www.worldsurfleague.com/posts/533717/its-on-finals-day-of-the-corona-fiji-pro

Category

breakage

Description

Video Player doesn't play when ublock is enabled

Other extensions used

none

Screenshot(s)

Screenshot(s)

Configuration

```yaml uBlock Origin: 1.59.0 Firefox: 129 filterset (summary): network: 153232 cosmetic: 47834 scriptlet: 20677 html: 1922 listset (total-discarded, last-updated): default: user-filters: 0-0, never ublock-filters: 39748-126, 11m Δ ublock-badware: 10669-6, 11m Δ ublock-privacy: 1061-4, 11m Δ ublock-unbreak: 2560-1, 11m Δ easylist: 85449-182, 11m Δ easyprivacy: 53065-66, 11m Δ urlhaus-1: 28920-0, now plowe-0: 3545-993, now ublock-quick-fixes: 185-4, 11m Δ filterset (user): [empty] trustedset: added: [array of 12 redacted] userSettings: [none] hiddenSettings: [none] supportStats: allReadyAfter: 1847 ms (selfie) maxAssetCacheWait: 648 ms cacheBackend: indexedDB popupPanel: blocked: 19 network: worldsurfleague.com: 2 amazon-adsystem.com: 1 doubleclick.net: 3 extremereach.io: 1 google-analytics.com: 2 googleadservices.com: 2 googletagmanager.com: 2 gstatic.com: 2 naivestatement.com: 1 rubiconproject.com: 2 snapchat.com: 1 extended: #@#div[data-ad-targeting] ```
stephenhawk8054 commented 2 months ago

@gorhill Sorry, can uBO support redirecting to noop XML with the format of VMAP and VAST?

Currently, Adguard is supporting noopvmap-1.0 and noopvast-2/3/4.0: https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-redirects.md#-available-redirect-resources

With this we don't need to allow and replace the ads connection

@@||pubads.g.doubleclick.net/gampad/ads?*www.worldsurfleague.com$xhr,domain=imasdk.googleapis.com
||pubads.g.doubleclick.net/gampad/ads?*www.worldsurfleague.com$xhr,domain=imasdk.googleapis.com,replace=/<vmap:VMAP.+//

I have to use replace because somehow xml-prune and trusted-replace-xhr-response don't work (it still logs successfully but it doesn't have effects like replace: the ads connections still occur).

But I think redirection to noop VMAP / VAST resources is still better.


This link is better to test than OP's link: https://www.worldsurfleague.com/posts/503101/kelly-slater-lost-tapes-a-new-year?s1=watch

The filters needed to test is here: https://github.com/uBlockOrigin/uAssets/blob/bba7c73a7349296bf96cede7bd5c009078166f66/filters/unbreak.txt#L5729-L5734

gorhill commented 2 months ago

noop-vmap1.0.xml is already supported, see https://github.com/gorhill/uBlock/blob/master/src/web_accessible_resources/noop-vmap1.0.xml. I can add the others.

stephenhawk8054 commented 2 months ago

Confirm

||pubads.g.doubleclick.net/gampad/ads?*www.worldsurfleague.com$xhr,redirect=noop-vmap1.0.xml:5,domain=imasdk.googleapis.com

works for me.

dimisa-RUAdList commented 1 month ago

uBlock Origin 1.59.1b18 + RU AdList

I found a problem in Firefox: https://fanserial.fun/748-kami-no-tou-2021-02-18-15-48/2-season/9-episode.html

When using ||v*.plrjs.org/*.xml$important,xmlhttprequest,redirect=noopvast-3.0 the player does not work, while in Google Chrome everything is fine. I had to add fanserial.fun,fanserialstv.net##+js(json-prune, *.preroll), but this fixes the problem only on a couple of sites, while I would like to apply a universal rule that will work correctly everywhere.

gorhill commented 1 month ago

Probably because of https://github.com/uBlockOrigin/uBlock-issues/issues/1222?


Actually the player is not broken on my side in Firefox, but then the filter is not reported in the logger, and I don't get requests matching plrjs.org/*.xml in the logger.

dimisa-RUAdList commented 1 month ago

In order for the rule ||v*.plrjs.org/*.xml$important,xmlhttprequest,redirect=noopvast-3.0 to work and break the player, you need to add the exception fanserial.fun,fanserialstv.net#@#+js(json-prune, *.preroll).

gorhill commented 1 month ago

Ok so I get:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at data:text/xml;base64,PFZBU1QgdmVyc2lvbj0iMy4wIj48L1ZBU1Q+Cg==. (Reason: CORS request not http).

So same issue as https://github.com/uBlockOrigin/uBlock-issues/issues/1222.

gorhill commented 1 month ago

I can make it work with that filter:

fanserial.fun##+js(no-xhr-if, url:/v.*\.plrjs\.org\/.*\.xml/, war:noop-vast3.xml)

But can't make it a universal filter.

dimisa-RUAdList commented 1 month ago

The thing is, I'm trying to avoid site-specific fixes. This is a pretty popular player and there could be hundreds of sites like this. The idea was to use a single rule everywhere: ||v*.plrjs.org/*.xml$important,xmlhttprequest,redirect=noopvast-3.0

This can't be fixed? In Google Chrome this rule works perfectly. Using this rule in AdGuard + FF also does not cause any problems.

gorhill commented 1 month ago

Oops, I used the wrong link in comments, I meant same issue as https://github.com/uBlockOrigin/uBlock-issues/issues/1222. This can't be fixed (except by the browser, see https://bugzilla.mozilla.org/show_bug.cgi?id=1645683)

stephenhawk8054 commented 1 month ago

@dimisa-RUAdList Which filter did you use in Adguard?

dimisa-RUAdList commented 1 month ago

The one they have in AdGuard RussianFilter: ||v*.plrjs.org/*.xml$xmlhttprequest,redirect=noopvast-3.0

stephenhawk8054 commented 1 month ago

If I'm not wrong, Adguard uses extension's ID (moz-extension://extension-id) as the URL to access web-accessible-resources, not data:. That would lead to no CORS error, but will leak extension's ID to the websites. In Firefox, each extension ID after intalling is unique (same extension but different install will yield different IDs) so leaking this ID is a privacy concern.


You can test by using the filter

||example.com^$xhr,redirect=noopvast-3.0

then load https://example.com, go to the console and type

fetch('https://example.com').then(response => console.log(response));

This is the result with Adguard:

![image](https://github.com/user-attachments/assets/630f7790-9d8f-4fbf-9eb2-2770ca979d0f)

This is the result with uBO:

![image](https://github.com/user-attachments/assets/8cd5bd32-bc94-4b79-ac48-5444b6fb7e96)
stephenhawk8054 commented 1 month ago

Not a perfect solution but these might help in unknown cases?

!#if cap_html_filtering
@@||plrjs.org/*.xml^$3p,xhr
||plrjs.org/*.xml^$3p,xhr,replace=/^.+$/<VAST version="3.0"><\/VAST>/s
||cdn.plrjs.com/player/*.js^$3p,script,replace=/preroll/nopreroll/g
!#else
||plrjs.org/*.xml^$3p,xhr,redirect=noopvast-3.0
!#endif

It depends on the cache as well, so better to test when refreshing while bypassing the cache.

dimisa-RUAdList commented 1 month ago

I can't put this in RU AdList because trusted rules only work from uBlock filters.

stephenhawk8054 commented 1 month ago

If they work fine, I'll put them to uAssets' lists

stephenhawk8054 commented 1 month ago

@gorhill Sorry, could there be any ways to have some non-trusted replace versions that replace with the text in war? Currently with my above replace filter, I just simply remove all of the contents and replace with noopvast-3.0

dimisa-RUAdList commented 1 month ago

@stephenhawk8054

If they work fine, I'll put them to uAssets' lists

Yes, it works fine, but for stable operation I will need to disable some rules for FF in RU AdList.

stephenhawk8054 commented 1 month ago

@dimisa-RUAdList I have edited to have a full version of network filters for both Firefox and Chromium. Can you check again? They should work with your current scriptlet filters in RuAdlist. The only concern is the important since it will override the @@||plrjs.org/*.xml^$3p,xhr


On another note, I think non-trusted versions for replace like my comment above might help for regional lists. We did talk briefly about a quite similar situation in https://github.com/uBlockOrigin/uAssets/issues/25164#issuecomment-2326647258 , but let's see how it turns out.

dimisa-RUAdList commented 1 month ago

No problem. I will disable ||v*.plrjs.org/*.xml$important,xmlhttprequest,redirect=noopvast-3.0 for FF.

dimisa-RUAdList commented 1 month ago

Disabled: https://github.com/easylist/ruadlist/commit/5393f6c158cb2488b2537d9cb67df7d6ee0b9dbe

stephenhawk8054 commented 1 month ago

Oh, forgot that noopvast is still in dev build, not in stable yet.

dimisa-RUAdList commented 1 month ago

That's why I haven't deleted it yet: fanserial.fun,fanserialstv.net##+js(set-constant, Object.prototype.preroll, undefined)

gorhill commented 1 month ago

could there be any ways to have some non-trusted replace versions that replace with the text in war?

Would need to experiment with this.