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

has() not work on <html> #1240

Closed
8 tasks done
imba-tjd opened this issue Sep 11, 2020 · 1 comment
Closed
8 tasks done

has() not work on <html> #1240

imba-tjd opened this issue Sep 11, 2020 · 1 comment
Labels
bug Something isn't working fixed issue has been addressed

Comments

@imba-tjd
Copy link

imba-tjd commented Sep 11, 2020

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

example.com##html

works but none of the

example.com##html:has(body)
example.com##html:has(div)
example.com##html:has-text(Example)

work.

If this wouldn't be fixed, some info needs adding to wiki.

A specific URL where the issue occurs

example.com

Your environment

  • uBlock Origin version: 1.29.3b12
  • Browser Name and version: FF 81.0b9
  • Operating System and version: Win10 20H2
@gorhill
Copy link
Member

gorhill commented Sep 11, 2020

This fails because there is this test before the node is further processed:

if ( node.parentElement === null ) { continue; }

html elements do not have a parent. I will have to remember why this test is there.

Edit: added in gorhill/uBlock@72bb700#diff-58abb088be4b02338aacb69a0580ab7fR808. I can't understand why this was added, so I will just remove it. It seems to be a stray test originally meant to be used for when removing nodes using the :remove() operator.

gorhill added a commit to gorhill/uBlock that referenced this issue Sep 11, 2020
@uBlock-user uBlock-user added bug Something isn't working fixed issue has been addressed labels Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

3 participants