You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is not present after disabling uBO in the browser.
I checked the documentation to understand that the issue I am reporting is not normal behavior.
I tried to reproduce the issue when...
uBO is the only extension.
uBO uses default lists and settings.
using a new, unmodified browser profile.
Description
What about a scriptlet that will return a different CSS property value to counter getComputedStyle() (maybe by proxying CSSStyleDeclaration.prototype.getPropertyValue) to foil sophisticated anti-blockers that check all CSS properties of an element (like megaup, aternos, ylilauta.org)?
Based on migration ra, rc to pseudo-classes syntax.
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.
On soft98.ir when I only add: soft98.ir##+js(spoof-css, a[href*="s0ft98.ir"], clip-path, none) or soft98.ir##+js(spoof-css, a[href*="s0ft98.ir"], nonsense, none)
Ok the page is doing something else than just checking the properties. For spoof-css to work on that site, I had to wholly remove the proxying of getComputedStyle(), so it does something with that call that triggers the detection.
Is it possible to specify not a static value but value obtainable from elements or scripts?
On https://github.com/uBlockOrigin/uAssets/discussions/17361#discussioncomment-6960192 an excerpt of detection code https://www.btcbitco.in/myassets/aOW9dugd31nhaaOW9dugd31nhd.js?ver= (direct access forbidden even with parameter)
Code
function aOW9dugd31nhests() {
var done = 20;
if (done === 0) {
setTimeout(function() {
if ($('.l-button').length > 0) {
$('.l-button').hide();
}
var aOW9dugd31nhe2 = document.getElementById('aOW9dugd31nhedz');
var aOW9dugd31nhe4 = aOW9dugd31nhe2.clientHeight;
if (!aOW9dugd31nhe2 || aOW9dugd31nhe4 != 97) {
if (typeof gtag === "function") {
gtag('event', 'session_ends');
}
alert("Session ends, thanks for using GainLink.");
window.location.href = 'https://www.btcbitco.in/page/endsessions';
}else{
aOW9dugd31nhest();
}
}, 4000);
} else {
if ($('.l-button').length > 0) {
$('.l-button').hide();
}
setTimeout(function() {
var aOW9dugd31nhek = document.getElementById('aOW9dugd31nhedz');
var aOW9dugd31nheh = aOW9dugd31nhek.clientHeight;
if (!aOW9dugd31nhek || aOW9dugd31nheh != 97) {
if (typeof gtag === "function") {
gtag('event', 'ads_blocker_detected');
}
var aOW9dugd31nhec = confirm("Go ahead and turn off your adblocker? Click 'OK' if you agree to turn off your adblocker or 'Cancel' to stop here.");
if (aOW9dugd31nhec === false) {
alert("Session ends, thanks for using GainLink.");
if (typeof gtag === "function") {
gtag('event', 'session_ends');
}
window.location.href = 'https://www.btcbitco.in/page/endsessions';
} else {
alert("Please disable your adblocker and reload");
}
}else{
$.ajax({
url: "https://www.btcbitco.in/page/validate?ver=1d75b01ce9033fe7764904b77212315e25779b17a25e77d79aafc9500edbd20e",
type: "GET",
success: function(response) {
if (response === "valid") {
aOW9dugd31nhest();
} else {
alert("Invalid response received!");
}
},
error: function() {
alert("An error occurred, please reload!");
location.reload();
}
});
}
}, 1000);
}
}
window.onload = function() {
var aOW9dugd31nhevd = document.createElement("iframe");
aOW9dugd31nhevd.src = "https://cryptocoinsad.com/ads/show.php?a=256522&b=397269";
aOW9dugd31nhevd.style = "width: 100%; height: 97px; overflow: hidden; border: 0px; padding: 0px; background-color: transparent;";
aOW9dugd31nhevd.id = "aOW9dugd31nhedz";
var aOW9dugd31nhezd = document.getElementsByClassName("entry-content")[0];
var aOW9dugd31nheparent = aOW9dugd31nhezd.parentNode;
aOW9dugd31nheparent.replaceChild(aOW9dugd31nhevd, aOW9dugd31nhezd);
function aOW9dugd31nhemm() {
var aOW9dugd31nheca = document.getElementById("aOW9dugd31nhedz");
if (aOW9dugd31nheca) {
clearInterval(aOW9dugd31nheid);
aOW9dugd31nhests();
}
}
var aOW9dugd31nheid = setInterval(aOW9dugd31nhemm, 1000);
}
They create a bait element with random height (here 97px, but varies on each load) and checks it. It's not inline so rpnt can't be used. As this is iframe, I just removed cosmetic filter and redirect=noop.html is enough, but the suggested capability may be useful.
kiktu.com doing the same now. A bait element getting added but with visiblity: hidden while the real element has visiblity: visible. Now the site checks if the bait has visiblity: visible or the real element visiblity: hidden and if yes -> Anti adblock.
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 trusted- scriptlets and we should share own idea to AdGuard (So that their add-on would not require bumping in the Moz://a store)?
Would something like Replace work for such cases ?
$replace could work, but only Firefox
Own replace need bumping uBo to 1.54.1+ or works like trusted- scriptlets
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.
My question is whether the $replace= filter added today to filters-2023.txt requires an update of stable ubo 1.54.0 to 1.54.1 (beta) or 1.54.2 (stable) to not break the Moz://a store limitation/policy/restriction.
For example, AdGuard $replace= has to wait for a new version of the add-on, and it is unlikely that the developers check whether the old restriction is already dead in order to keep the filter active without a forced update of the entire extension.
Activity
krystian3w commentedon Apr 28, 2023
Why not:
Based on migration
ra,rcto pseudo-classes syntax.MasterKia commentedon Apr 28, 2023
Nice idea. My only concern is that we might experience the same problem with
##body:remove-attr(oncontextmenu)sometimes not working on Chromium.krystian3w commentedon Apr 28, 2023
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 "
<script> </script>" section (https://kornel-ski.translate.goog/pl/onclick?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=pl&_x_tr_pto=wapp).uBlock-user commentedon Apr 28, 2023
Use
##body:remove-attr(oncontextmenu):watch-attr(oncontextmenu)then.krystian3w commentedon Apr 28, 2023
#2618 (comment) - This solve trouble with blocked right click on 99% of pages?
gorhill commentedon May 20, 2023
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.
krystian3w commentedon May 20, 2023
And are there any plans to e.g. on
musixmatch.comreplace+js(ra, oncontextmenu, body, complete)to+js(nowoif, something)?gorhill commentedon May 20, 2023
Can I get real world examples (preferably not requiring account) for which I can test such scriptlet?
peace2000 commentedon May 20, 2023
https://ylilauta.org/jorma/131700539To spoof that
##iframe.ahas valuedisplay: blockeven if it's truly hidden?gorhill commentedon May 20, 2023
When I use
##iframe.a, the frame is not hidden, is there an exception filter? If so I am not seeing it in the logger.Ok never mind, code stepping I see an exception filter, not reported in logger. It works if I use
##iframe.a.a.Add `spoof-css` scriptlet
MasterKia commentedon May 24, 2023
On
soft98.irwhen I only add:soft98.ir##+js(spoof-css, a[href*="s0ft98.ir"], clip-path, none)orsoft98.ir##+js(spoof-css, a[href*="s0ft98.ir"], nonsense, none)I get detection after a few seconds.
But if I use this userscript:
and then use this filter:
soft98.ir##a[href*="s0ft98.ir"]:style(clip-path: circle(0) !important;)Then I get no detection.
Edit: added
@run-at.gorhill commentedon May 24, 2023
I tried with ViolentMonkey and I still get detection with your script.
Ok, seems to work when using
// @run-at document-start.gorhill commentedon May 24, 2023
Note that your code has an issue but it accidentally works because of truthiness. Should be:
gorhill commentedon May 24, 2023
Ok the page is doing something else than just checking the properties. For
spoof-cssto work on that site, I had to wholly remove the proxying ofgetComputedStyle(), so it does something with that call that triggers the detection.3 remaining items
Yuki2718 commentedon Sep 10, 2023
Is it possible to specify not a static value but value obtainable from elements or scripts?
On
https://github.com/uBlockOrigin/uAssets/discussions/17361#discussioncomment-6960192an excerpt of detection codehttps://www.btcbitco.in/myassets/aOW9dugd31nhaaOW9dugd31nhd.js?ver=(direct access forbidden even with parameter)Code
JobcenterTycoon commentedon Nov 22, 2023
kiktu.comdoing the same now. A bait element getting added but withvisiblity: hiddenwhile the real element hasvisiblity: visible. Now the site checks if the bait hasvisiblity: visibleor the real elementvisiblity: hiddenand if yes -> Anti adblock.BlazeFTL commentedon Nov 24, 2023
Another issue
terabox.fun/sl/3lsTuo98O3script Location is 3p
Screenshot_20231124-115033_Firefox Nightly
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 ?
stephenhawk8054 commentedon Nov 24, 2023
$replacecould work, but only Firefoxkrystian3w commentedon Nov 24, 2023
Own replace need bumping uBo to 1.54.1+ or works like
trusted-scriptlets and we should share own idea to AdGuard (So that their add-on would not require bumping in the Moz://a store)?gorhill commentedon Nov 25, 2023
I don't understand what is being said here.
krystian3w commentedon Nov 25, 2023
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.
gorhill commentedon Nov 25, 2023
I still don't understand.
replace=is available in 1.54.0 as a trusted-source filter option.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.
krystian3w commentedon Nov 25, 2023
I ask here because that's what BlazeFTL did.
My question is whether the
$replace=filter added today to filters-2023.txt requires an update of stable ubo 1.54.0 to 1.54.1 (beta) or 1.54.2 (stable) to not break the Moz://a store limitation/policy/restriction.For example, AdGuard
$replace=has to wait for a new version of the add-on, and it is unlikely that the developers check whether the old restriction is already dead in order to keep the filter active without a forced update of the entire extension.gorhill commentedon Nov 25, 2023
You have a source for this? I used the debugger in Firefox and I can see AdGuard parse
replace=filters when updating AdGuard Base.BlazeFTL commentedon Apr 19, 2024
Spoof-css Makes Stuck At Checking Browser In FF Android
Random Anti Adb On Chrome Based Browser🥲
https://devuploads.com/fcdlxmzxep5oFilters Used
Add `spoof-css` scriptlet
Properly return inherited methods in property getter in spoof-css scr…