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

:upward() does not work if the URL has a slash in it (path) #2080

Closed
8 tasks done
ghost opened this issue Apr 6, 2022 · 4 comments
Closed
8 tasks done

:upward() does not work if the URL has a slash in it (path) #2080

ghost opened this issue Apr 6, 2022 · 4 comments
Labels
invalid not a uBlock issue

Comments

@ghost
Copy link

ghost commented Apr 6, 2022

Prerequisites

I tried to reproduce the issue when...

  • uBO is the only extension
  • uBO with default lists/settings
  • using a new, unmodified browser profile

Description

I've tried this DOM transcending goodness in-order to get rid of the garbage that is quora answers:
google.co.uk/search##a[href*="quora.com"]:upward(div.ZINbbc)
it didn't seems to work so I've simplified it to (for testing purposes):
google.com##a[href*="quora.com"]:upward(div.ZINbbc)
and it worked just fine.
so I've assumed it is a bug.

here is good testing page (limits to www.quora.com)
https://www.google.co.uk/search?num=20&gbv=1&tbs=qdr%3Am&q=site%3Awww.quora.com+stuff&oq=&aqs=

note: if you test stuff, note that google.com has a different structure.

A specific URL where the issue occurs

https://www.google.co.uk/search?num=20&gbv=1&tbs=qdr%3Am&q=site%3Awww.quora.com+stuff&oq=&aqs=

Steps to Reproduce

  1. add rule provided in the description (with /search).
  2. browse provided URL.
  3. note the :upward not working.
  4. remove /search from rule
  5. refresh.
  6. note it works now.

Expected behavior

allow URLs with paths.

Actual behavior

URLs with paths will not work.

uBlock Origin version

1.41.9b0

Browser name and version

Chromium 99.0.4844.51 (https://github.com/Hibbiki/chromium-win64/releases/download/v99.0.4844.51-r961656/chrome.sync.7z)

Operating System and version

Windows 10

@NoMeansNowastaken
Copy link

It only supports hostnames, not paths

@mapx-
Copy link
Contributor

mapx- commented Apr 7, 2022

use matches-path
https://github.com/gorhill/uBlock/wiki/Procedural-cosmetic-filters#subjectmatches-patharg

working on my side:
google.co.uk##:matches-path(/search) a[href*="quora.com"]:upward([data-hveid])

@mapx- mapx- closed this as completed Apr 7, 2022
@gorhill gorhill added the invalid not a uBlock issue label Apr 7, 2022
@gorhill
Copy link
Member

gorhill commented Apr 7, 2022

That page is a subpage of https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#static-extended-filtering, where it is mentioned:

Static extended filters are all of the form:

[hostname(s)]##[expression]
[hostname(s)]#@#[expression]

@gorhill
Copy link
Member

gorhill commented Apr 7, 2022

Actually I was expecting that in google.co.uk/search##a, google.co.uk/search would be highlighted as an error, but it's not. I need to fix this.

gorhill added a commit to gorhill/uBlock that referenced this issue Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid not a uBlock issue
Projects
None yet
Development

No branches or pull requests

3 participants