Skip to content
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

ebay.com: ads #23491

Open
10 of 11 tasks
sha-265 opened this issue Apr 29, 2024 · 33 comments
Open
10 of 11 tasks

ebay.com: ads #23491

sha-265 opened this issue Apr 29, 2024 · 33 comments

Comments

@sha-265
Copy link

sha-265 commented Apr 29, 2024

Prerequisites

  • This is NOT a YouTube, Facebook, Twitch or a shortener/hosting site report. These sites MUST be reported by clicking their respective links.
  • I read and understand the policy about what is a valid filter issue.
  • I verified that this issue is not a duplicate. (Use this button to find out.)
  • I did not remove any of the default filter lists, or I have verified that the issue was not caused by removing any of the default lists.
  • I did not enable additional filter lists, or I have verified that the issue still occurs without enabling additional filter lists.
  • I do not have custom filters/rules, or I have verified that the issue still occurs without custom filters/rules.
  • I am not using uBlock Origin along with other content blockers.
  • I have verified that the web browser's built-in content blocker/tracking protection, network wide/DNS blocking, or my VPN is not causing the issue.
  • I have verified that other extensions are not causing the issue.
  • If this is about a breakage or detection, I have verified that it is caused by uBlock Origin and isn't a site issue.
  • I did not answer truthfully to ALL the above checkboxes.

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

Configuration

uBlock Origin: 1.57.2
Firefox: 125
filterset (summary):
 network: 145565
 cosmetic: 47666
 scriptlet: 19277
 html: 1793
listset (total-discarded, last-updated):
 removed:
  plowe-0: null
 added:
  adguard-spyware-url: 1504-120, now
  block-lan: 66-0, now
  fanboy-thirdparty_social: 68-0, now
  dpollock-0: 11669-369, now
  ISR-0: 1866-3, now
 default:
  user-filters: 5-0, never
  ublock-filters: 37821-109, now
  ublock-badware: 8450-0, now
  ublock-privacy: 875-2, now
  ublock-unbreak: 2321-2, now
  ublock-quick-fixes: 183-18, now
  easylist: 86849-174, now
  easyprivacy: 50825-64, now
  urlhaus-1: 12750-0, now
filterset (user): [array of 6 redacted]
trustedset:
 added: [array of 1 redacted]
hostRuleset:
 added: [array of 3 redacted]
userSettings:
 advancedUserEnabled: true
 cloudStorageEnabled: true
 cnameUncloakEnabled: false
hiddenSettings: [none]
supportStats:
 allReadyAfter: 4510 ms (selfie)
 maxAssetCacheWait: 229 ms
 cacheBackend: indexedDB
popupPanel:
 blocked: 9
 network:
  ebay.com: 4
  ebaystatic.com: 5
 extended:
  ##div[title="ADVERTISEMENT"]
@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Apr 30, 2024

They are using content inside ::before so I don't think this can be solved.

@sha-265
Copy link
Author

sha-265 commented Apr 30, 2024

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?

@stephenhawk8054
Copy link
Member

Every item has <span data-w="Sponsored">, it's just some show the text, and some hide the text

@gwarser
Copy link
Contributor

gwarser commented Apr 30, 2024

span[data-w]:matches-css-before(content: /attr/)

@stephenhawk8054
Copy link
Member

Oh, didn't know there's :matches-css-before, but looks like I'm mistaken, it might not be related to content

@sha-265
Copy link
Author

sha-265 commented Apr 30, 2024

so is it solvable or not?

@stephenhawk8054
Copy link
Member

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.

@u-RraaLL
Copy link
Contributor

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.

@gwarser
Copy link
Contributor

gwarser commented Apr 30, 2024

check the value of the ID in one element against the value of another attribute in listing items.

Should be possible with XPath.

@u-RraaLL
Copy link
Contributor

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]

@Yuki2718
Copy link
Contributor

Yuki2718 commented May 4, 2024

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.

@mapx-
Copy link
Contributor

mapx- commented May 4, 2024

see for example
https://www.ebay.com/b/32-Degrees/bn_7064048796

image

@Yuki2718
Copy link
Contributor

Yuki2718 commented May 4, 2024

@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?

@Yuki2718
Copy link
Contributor

Yuki2718 commented May 4, 2024

It seems Sponsored items have longer links like FB. Or just ##.s-item__wrapper:has(a[href*="&amdata="])?

@u-RraaLL
Copy link
Contributor

u-RraaLL commented May 4, 2024

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

@Yuki2718
Copy link
Contributor

Yuki2718 commented May 5, 2024

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 added a commit to easylist/easylist that referenced this issue May 5, 2024
@sha-265
Copy link
Author

sha-265 commented May 5, 2024

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

@Yuki2718
Copy link
Contributor

Yuki2718 commented May 6, 2024

I know, but I first have to reproduce the ads you guys see. Which country do you access from?

@mapx-
Copy link
Contributor

mapx- commented May 6, 2024

on my example page your filter is working fine (FR, US, DE, etc)

@u-RraaLL
Copy link
Contributor

u-RraaLL commented May 6, 2024

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

@sha-265
Copy link
Author

sha-265 commented May 6, 2024

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:
image

@u-RraaLL
Copy link
Contributor

u-RraaLL commented May 6, 2024

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 :)

@Yuki2718
Copy link
Contributor

Yuki2718 commented May 7, 2024

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()

@sha-265
Copy link
Author

sha-265 commented May 7, 2024

When creating the filter, it is working, but after page refresh the sponsored items are shown again

@Yuki2718
Copy link
Contributor

Yuki2718 commented May 8, 2024

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?

@Yuki2718
Copy link
Contributor

Yuki2718 commented May 10, 2024

Maybe :watch-attr()doesn't watch attributes specified in :xpath()? @gorhill

STR

  1. Visit https://www.ebay.com/sch/i.html?_from=R40&_nkw=ps5&_sacat=0
  2. Check ##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 picker
  3. Create the rule
  4. Refresh the page and see sponsored items are not hidden
  5. Same with ebay.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 ")])
  6. Somehow 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 everything

But 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.

@gwarser
Copy link
Contributor

gwarser commented May 11, 2024

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.

@Yuki2718
Copy link
Contributor

Should body be added to all existing ##:xpath rules?

@u-RraaLL
Copy link
Contributor

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.

@sha-265
Copy link
Author

sha-265 commented May 20, 2024

any updates?

@JobcenterTycoon
Copy link
Contributor

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")}}();)

@Yuki2718
Copy link
Contributor

Yuki2718 commented May 23, 2024

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?

@JobcenterTycoon
Copy link
Contributor

JobcenterTycoon commented May 23, 2024

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.

@Yuki2718 Yuki2718 added the fixed label May 24, 2024
@JobcenterTycoon JobcenterTycoon added ongoing ongoing issue and removed fixed labels May 25, 2024
@JobcenterTycoon JobcenterTycoon removed the ongoing ongoing issue label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants