-
Notifications
You must be signed in to change notification settings - Fork 82
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
Scriptlet to spoof CSS property value #2618
Comments
Why not: example.com##a[href*="ads/redirect/"] > img:spoof(clip-path: none !important;)
example.com##a[href*="ads/redirect/"] > img:style(clip-path: circle(0) !important;) Based on migration |
Nice idea. My only concern is that we might experience the same problem with |
I suppose this trouble can only apply to javascript written with html attributes: https://www.w3schools.com/tags/ref_eventattributes.asp which is not recommended - actions should be created in the file or " |
Use |
#2618 (comment) - This solve trouble with blocked right click on 99% of pages? |
Spoofing requires to patch JavaScript calls, which can only be done in the page world. Code for procedural cosmetic filters execute in content script world. |
And are there any plans to e.g. on |
Can I get real world examples (preferably not requiring account) for which I can test such scriptlet? |
To spoof that |
When I use Ok never mind, code stepping I see an exception filter, not reported in logger. It works if I use |
Related issue: - uBlockOrigin/uBlock-issues#2618 Usage: example.com##+js(spoof-css, selector, property-name, property-value, ...) - selector: a valid CSS selector which matches the elements for which the spoofing must apply. - property-name: a CSS property name (can be dashed- or camel-cased) - property-value: the value to return regardless of the currently computed value. There can be any number of property-name/property-value pairs, all separated by commas. A special property-name/property-value pair `debug/1` can be used to force the browser to break when `getComputedStyle()` or `getBoundingClientrect()` is called, useful to help pinpoint usage of those calls in the page's source code: example.com##+js(spoof-css, .ad, debug, 1)
On I get detection after a few seconds. But if I use this userscript: // @run-at document-start
(function () {
'use strict';
const handler = {
apply(target, thisArg, args) {
let response = Reflect.apply(target, thisArg, args);
if (args == "clip-path" || args == "clipPath") {
response = "none";
}
return response;
}
}
const myProxy = new Proxy(CSSStyleDeclaration.prototype.getPropertyValue, handler);
CSSStyleDeclaration.prototype.getPropertyValue = myProxy;
}) (); and then use this filter: Then I get no detection. Edit: added |
I tried with ViolentMonkey and I still get detection with your script. Ok, seems to work when using |
Note that your code has an issue but it accidentally works because of truthiness. Should be:
|
Ok the page is doing something else than just checking the properties. For |
This comment was marked as resolved.
This comment was marked as resolved.
…iptlet Related feedback: - uBlockOrigin/uBlock-issues#2618 (comment)
Is it possible to specify not a static value but value obtainable from elements or scripts? Code
|
|
Another issue script Location is 3p Is there any way to modify script values which arent inline ?... ideally what i do is replace the element they check with a element that wouldnt be blocked with rpnt Would something like Replace work for such cases ? |
|
Own replace need bumping uBo to 1.54.1+ or works like |
I don't understand what is being said here. |
So I ask, if stephenhawk8054 adds a filter, will it start in uBo 1.54.0 with a differential update or a full filter list alone, because if AdGuard would add it I would have to wait for the next version of the add-on in December 2023 or January 2024. This could be added to the wiki that our replace does not require an update of the entire add-on or that we have identically solved this as in AdGuard and such a filter will start after a month or in beta releases. |
I still don't understand. Differential update has nothing to do with this, I don't know why you mention this, and I also don't understand why you mention AdGuard. |
I ask here because that's what BlazeFTL did. My question is whether the For example, AdGuard |
You have a source for this? I used the debugger in Firefox and I can see AdGuard parse |
Spoof-css Makes Stuck At Checking Browser In FF Android
|
Prerequisites
I tried to reproduce the issue when...
Description
What about a scriptlet that will return a different CSS property value to counter
getComputedStyle()
(maybe by proxyingCSSStyleDeclaration.prototype.getPropertyValue
) to foil sophisticated anti-blockers that check all CSS properties of an element (likemegaup
,aternos
,ylilauta.org
)?A specific URL where the issue occurs.
.
Steps to Reproduce
.
Expected behavior
.
Actual behavior
.
uBO version
.
Browser name and version
.
Operating System and version
.
The text was updated successfully, but these errors were encountered: