Open sha-265 opened 7 months ago
They are using content
inside ::before
so I don't think this can be solved.
They are using
content
inside::before
so I don't think this can be solved.
@stephenhawk8054 can't we use has()
element <span data-w="Sponsored">
, or something like that?
Every item has <span data-w="Sponsored">
, it's just some show the text, and some hide the text
span[data-w]:matches-css-before(content: /attr/)
Oh, didn't know there's :matches-css-before
, but looks like I'm mistaken, it might not be related to content
so is it solvable or not?
Others may find some ways, but currently I don't know how to address it.
It uses 2 transform: rotate
steps to rotate the "sponsored" text. The sponsored items will be rotated back to normal position and we can see the "sponsored" text, others will be rotated out of view and we cannot see that text.
From what I can tell, the rotation and attribute values are generated randomly, server-side on each page load (blocking all scripts, changes nothing).
The attribute value is mentioned in another element though, so we'd need a procedural that can check the value of the ID in one element against the value of another attribute in listing items.
check the value of the ID in one element against the value of another attribute in listing items.
Should be possible with XPath.
I was wondering about that. But it's not within my skillset to attempt this.
##[aria-hidden="true"]>span.clipped[id]:not(:has(+[aria-labelledby]))
##.s-item [aria-labelledby]
Are we talking about Sponsored in the screenshot? I don't see sponsored at all, maybe geolocation. When I visit https://www.ebay.com/sch/i.html
I'm redirected to https://www.ebay.com/n/all-categories
which looks very different.
see for example
https://www.ebay.com/b/32-Degrees/bn_7064048796
@u-RraaLL
The attribute value is mentioned in another element though, so we'd need a procedural that can check the value of the ID in one element against the value of another attribute in listing items.
What exactly?
It seems Sponsored items have longer links like FB. Or just ##.s-item__wrapper:has(a[href*="&amdata="])
?
What exactly?
I've mentioned them above. The value of id in body>[aria-hidden="true"]>span.clipped[id]:not(:has(+[aria-labelledby]))
is the same as sponsored's .s-item [aria-labelledby]
.
It seems Sponsored items have longer links like FB. Or just
##.s-item__wrapper:has(a[href*="&amdata="])
?
Oh, it is? Guess we can check that.
That selector doesn't work for me though - it only finds one thing which is not part of the results?
https://imgur.com/RcLh4bB.png and https://imgur.com/TAZs58j.png
Maybe geolocation, it's working for me and I'll add to EL unless it causes FP on your side. Whoops, the rule leaves leftover. So ##.s-item:has(a[href*="&amdata="])
Maybe geolocation, it's working for me and I'll add to EL unless it causes FP on your side. Whoops, the rule leaves leftover. So
##.s-item:has(a[href*="&amdata="])
@Yuki2718, this filter is not working for me, sponsored items still shown
I know, but I first have to reproduce the ads you guys see. Which country do you access from?
on my example page your filter is working fine (FR, US, DE, etc)
You're right. The filter works fine when browsing by category. It just doesn't affect search results
https://www.ebay.com/sch/i.html?_from=R40&_nkw=ps5&_sacat=0
I know, but I first have to reproduce the ads you guys see. Which country do you access from?
@Yuki2718, Israel
You're right. The filter works fine when browsing by category. It just doesn't affect search results
https://www.ebay.com/sch/i.html?_from=R40&_nkw=ps5&_sacat=0
@u-RraaLL, not for me. This is a screen shot from the page you linked to:
I was replying to mapx, who was referring to his URL which is "browse by a category".
I said the filter doesn't work on search results and provided an example for that. So you're just confirming what I said :)
Test
ebay.com##:xpath(//li[contains(@class, "s-item ")]//span[@aria-labelledby=ancestor::body//span[@class="clipped" and @id and not(following-sibling::span[1 and @aria-labelledby])]/@id]/ancestor::li[contains(@class, "s-item ")])
Looks doesn't work, maybe needs :watch-attr()
When creating the filter, it is working, but after page refresh the sponsored items are shown again
The rule works with AdGuard but with noticeble delay to display the page. So I suspect it's a matter of :watch-attr()
. But even
ebay.com##*:watch-attr(aria-labelledby,class,id):xpath(//li[contains(@class, "s-item ")]//span[@aria-labelledby=ancestor::body//span[@class="clipped" and @id and not(following-sibling::span[1 and @aria-labelledby])]/@id]/ancestor::li[contains(@class, "s-item ")])
doesn't work. Any idea? And somehow if I add :remove()
, it removes all the content. Bug?
Maybe :watch-attr()
doesn't watch attributes specified in :xpath()
? @gorhill
STR
https://www.ebay.com/sch/i.html?_from=R40&_nkw=ps5&_sacat=0
##body:xpath(//li[contains(@class, "s-item ")]//span[@aria-labelledby=ancestor::body//span[@class="clipped" and @id and not(following-sibling::span[1 and @aria-labelledby])]/@id]/ancestor::li[contains(@class, "s-item ")])
hides sponsored items with the pickerebay.com##body:watch-attr(aria-labelledby,class,id):xpath(//li[contains(@class, "s-item ")]//span[@aria-labelledby=ancestor::body//span[@class="clipped" and @id and not(following-sibling::span[1 and @aria-labelledby])]/@id]/ancestor::li[contains(@class, "s-item ")])
ebay.com##body:xpath(//li[contains(@class, "s-item ")]//span[@aria-labelledby=ancestor::body//span[@class="clipped" and @id and not(following-sibling::span[1 and @aria-labelledby])]/@id]/ancestor::li[contains(@class, "s-item ")]):remove()
removes everythingBut ebay.com##body:xpath(//li[contains(@class, "s-item ")]//span[@aria-labelledby=ancestor::body//span[@class="clipped" and @id and not(following-sibling::span[1 and @aria-labelledby])]/@id]/ancestor::li[contains(@class, "s-item ")])
works with AdGuard, though with noticebly slower loading.
Do not use wildcard, this executes xpath on every element (freezes my browser). Start with body or html.
No idea why it works fine in picker, but does not from my filters.
Should body
be added to all existing ##:xpath
rules?
No idea why it works fine in picker, but does not from my filters.
Maybe xpath executes too early?
body>[aria-hidden="true"]>span.clipped[id]:not(:has(+[aria-labelledby]))
This selector works only after the page finished loading. Earlier there's another element there too. It corresponds to the "dummy sponsored" and gets deleted by an inline script.
any updates?
Userscript which hide the ads in the search results:
ebay.com##+js(rpnt, script, removeItem("SRP.PLBTimestamp");o(true)}}}\,3e3)})}})(), removeItem("SRP.PLBTimestamp");o(true)}}}\,3e3)})}})(); !function(){let e=document.querySelectorAll(".srp-results > .s-item");for(let t=0;t<e.length;t++){let r=e[t].querySelector('span[aria-hidden="true"][data-w="Sponsored"]')\,l=(r=window.getComputedStyle(r).getPropertyValue("transform")).split("(")[1].split(")")[0].split("\,")\,o=l[0]\,a=l[1];l[2]\,l[3];let s=Math.round(Math.atan2(a\,o)*(180/Math.PI))\,n=e[t].querySelector('span[aria-hidden="true"][data-w="Sponsored"]')\,p=(n=window.getComputedStyle(n\,"::before").getPropertyValue("transform")).split("(")[1].split(")")[0].split("\,")\,d=p[0]\,u=p[1];p[2]\,p[3];let i=Math.round(Math.atan2(u\,d)*(180/Math.PI));s+i>=-1&&s+i<=1&&(e[t].style.display="none")}}();)
So this can be fixed with rpnt. I still wonder why the xpath filter doesn't work with uBO. BTW [data-w="Sponsored"]
is for English interface. I guess [data-w]
is unique enough?
So
ebay.*##+js(rpnt, script, removeItem("SRP.PLBTimestamp");o(true)}}}\,3e3)})}})(), removeItem("SRP.PLBTimestamp");o(true)}}}\,3e3)})}})(); !function(){let e=document.querySelectorAll(".srp-results > .s-item");for(let t=0;t<e.length;t++){let r=e[t].querySelector('span[aria-hidden="true"][data-w]')\,l=(r=window.getComputedStyle(r).getPropertyValue("transform")).split("(")[1].split(")")[0].split("\,")\,o=l[0]\,a=l[1];l[2]\,l[3];let s=Math.round(Math.atan2(a\,o)*(180/Math.PI))\,n=e[t].querySelector('span[aria-hidden="true"][data-w]')\,p=(n=window.getComputedStyle(n\,"::before").getPropertyValue("transform")).split("(")[1].split(")")[0].split("\,")\,d=p[0]\,u=p[1];p[2]\,p[3];let i=Math.round(Math.atan2(u\,d)*(180/Math.PI));s+i>=-1&&s+i<=1&&(e[t].style.display="none")}}();)
to cover also regional sites like ebay.de
. Saw no breakage so far (checked without account). For the xpath issue i don’t know i never work with xpath.
@JobcenterTycoon you forgot to close this issue
I don't know why you closed this issue. Ads are still shown on eBay.
There were no feedbacks at that time (5 months ago), so it's normal to close. If you see the ads, just continue here, no need for asking why closing the issue.
I will ask why this issue is closed, because I can't reopen it my self.
The problem never solved. No one asked for feedback.
No one was able to reproduce the issue after the filters were added, hence it's closed. If no one continued commenting, we of course couldn't know the issue's state.
Anyways, if any volunteers are able to reproduce, they will re-open.
Though I can reproduce on https://www.ebay.com/sch/i.html?_from=R40&_nkw=ps5&_sacat=0
, it's almost "Can't fix" when they even counter JS fixes.
I keep this opened since it might be worth @gorhill 's investigation why ebay.com##body:xpath(//li[contains(@class, "s-item ")]//span[@aria-labelledby=ancestor::body//span[@class="clipped" and @id and not(following-sibling::span[1 and @aria-labelledby])]/@id]/ancestor::li[contains(@class, "s-item ")])
doesn't work even with :watch-attr()
as I said in https://github.com/uBlockOrigin/uAssets/issues/23491#issuecomment-2104309049 The rule works on AG MV2 extension. It might possibly be that performance-hit reached the limit, but I'm not sure.
No one was able to reproduce the issue after the filters were added, hence it's closed. If no one continued commenting, we of course couldn't know the issue's state.
No one said he is unable to reproduce, because no one asked to try it. I can't even find this filter in my uBO.
It might possibly be that performance-hit reached the limit,
Yes, that filter is too CPU expensive to enforce:
Execution time well over a second per DOM mutation processing cycle, so uBO disables it.
When I use this filter in AdGuard MV3, it does work, but page load takes very long, and profiler shows that over 20 seconds was spend in AdGuard's content script's code at page load time, and more specifically the browser's own document.evaluate(xpath)
code.
No one was able to reproduce the issue after the filters were added, hence it's closed. If no one continued commenting, we of course couldn't know the issue's state.
No one said he is unable to reproduce, because no one asked to try it. I can't even find this filter in my uBO.
There were 2 comments for 2 filters above. Anyone who wants to test can read the above:
We are not customer service to ask each person for testing, everyone can read the comments.
Btw, this one looks working for me, but I'm not too sure:
ebay.com##+js(rpnt, script, (function(scope){, '(()=>{document.querySelectorAll("li.s-item").forEach((item=>{const divItem=item.querySelector("span[data-w] > div");const styles=window.getComputedStyle(divItem);let sums=0;for(const style of["padding-top","transform","margin-top"]){if(style==="transform"){const matrix=new WebKitCSSMatrix(styles.webkitTransform);sums+=matrix.m42}else{sums+=window.parseInt(styles[style].split("px")[0])}}if(sums===0){item.style.display="none"}}))})();(function(scope){')
I haven't tested with other TLDs (ebay.de
) yet.
Btw, this one looks working for me, but I'm not too sure:
It works on my end, feel free to add. The thing is just that nobody seems to be willing to keep the cat-and-mouse game with them.
On some searches for example: https://www.ebay.de/sch/i.html?_nkw=handy there is a top-banner-ad shown only verified on ebay.de
On some searches for example: https://www.ebay.de/sch/i.html?_nkw=handy there is a top-banner-ad shown only verified on ebay.de
Looks to be self-promotion though it says Anzeige
.
Execution time well over a second per DOM mutation processing cycle, so uBO disables it.
Can each determine on his own his tolerance for waiting (processing)? then adjusting some setting per domain or globally?
Prerequisites
URL address of the web page
https://www.ebay.com/sch/i.html
Category
ads
Description
Some sponsored listings are appears in search results in eBay
Other extensions used
CanvasBlocker
Screenshot(s)
Screenshot(s)
![image](https://github.com/uBlockOrigin/uAssets/assets/4103710/fdf3de9f-0493-4084-a11f-271699c96968)Configuration