uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
945 stars 81 forks source link

Feature Request: AG `trusted-replace-xhr-response` scriptlet #2743

Closed piquark6046 closed 1 year ago

piquark6046 commented 1 year ago

Prerequisites

I tried to reproduce the issue when...

Description

https://github.com/AdguardTeam/Scriptlets/blob/master/wiki/about-trusted-scriptlets.md#-%EF%B8%8F-trusted-replace-xhr-response

Recently, YouTube started neutralizing adblockers so they would stop working on their website. But, @AdamWr found a method blocking the anti-adblock script using trusted-replace-fetch-response trusted scriptlet of AdGuard. Supporting trusted-replace-xhr-response scriptlet can be used in the future when they change the method.

A specific URL where the issue occurs.

https://listauthorschat.slack.com/archives/C010N14G4TF/p1689868182037289?thread_ts=1683754186.016929&cid=C010N14G4TF

Steps to Reproduce

None.

Expected behavior

Applying a trusted-replace-xhr-response filter can help to resolve YouTube anti-adblock issue when they change from fetch to XMLHttpRequest.

Actual behavior

There is no way to apply a trusted-replace-xhr-response scriptlet filter of AdGuard in uBO.

uBO version

1.50.0

Browser name and version

Mozilla Firefox Developer Edition 116.0b7

Operating System and version

Ubuntu 23.04

piquark6046 commented 1 year ago

@gwarser Why did you closed this as duplicate?

gwarser commented 1 year ago

I meant, #2743.

uBlock-user commented 1 year ago

Both should be merged in one, imo.

gorhill commented 1 year ago

I meant, #2743.

I am confused. The issue here is #2743.

gwarser commented 1 year ago

??? How this happened? #2742 !

gorhill commented 1 year ago

2742

Those two scriptlets are distinct in AdGuard, so if I want good compatibility, I need to have two distinct scriptlets even though internally they may fall back to same code path.

krystian3w commented 1 year ago

One of two* done: https://github.com/gorhill/uBlock/commit/82a7d11f78b0b51d742040b620b99bde62b73798

* = I don't know if there are plans to transfer some of the scripting to the module in the future.