Skip to content

GitLab

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    • Menu
    Projects Groups Snippets
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • A adblockpluscore
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 86
    • Issues 86
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Jira
    • Jira
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 is launching on May 22! This version brings many exciting improvements, but also removes deprecated features and introduces breaking changes that may impact your workflow. To see what is being deprecated and removed, please visit Breaking changes in 15.0 and Deprecations.

  • eyeo
  • adblockplus
  • abc
  • adblockpluscore
  • Issues
  • #229
Closed
Open
Created Jul 01, 2020 by Imre Kristoffer Eilertsen@DandelionSprout

Make ":has"/":has-text" equivalent to ":-abp-has"/":-abp-contains"

Background

Now that I've become an employee of Eyeo GmbH as of today, that should hopefully give me a bit more clout to influence the codebase to make it more suited for all the listmakers out there.

Essentially, I've noticed that many listmakers out there, somewhere north of 50%, possibly as many as 80%, are completely unaware of the existence of the :-abp-has and :-abp-contains syntaxes. Instead they only know about :has and :has-text, thinking that such pseudo-selectors are non-existent in ABP, and they also often lock them behind !#include file-loadings meant for uBlock Origin).

This makes their lists often work considerably worse in ABP than in other major adblockers. Example of general unawareness among listmakers: The ":has" entries in the extra-file of Frellwit's Swedish Filters

In other cases, they may be unaware of such pseudoselectors at all, which means their lists are still pretty much only using 2015-16-era ABP syntaxes. Example: Slovenian List

What to change

Create a syntax synonym(?) where :has entries are treated as :-abp-has, and :has-text entries are treated as :-abp-contains.

For 100% implementation of this, it may also become necessary to have ABP begin to treat all entries as if they had question marks in the hashtags (e.g. #?#.), since question-mark use is also pretty rare among listmakers who are more familiar with uBO. I plan to make a separate issue report for that, if this particular issue report became a success. In fact I have a lot of change suggestions I could've made in the next couple weeks or so.

It is decided to keep the Element Hiding Emulation separator #?# as a requirement.

  • uBO silently converts #?# into ##, so filters' authors can write #?#:has(...) once, and see this working as expected in multiple extensions. AdGuard supports it.
  • ##:has(...) will be CSS4 native spec and is not widely available yet. When it is it can be used, still with the condition that the browser supports it without change he.
  • we keep separated our own emulation vs native CSS as it may have subtle behaviour difference that could break when the is a native CSS4 implementation. Also there is no :has-text() in any current proposal, so this ensure there is no long term conflict.

Ref: https://github.com/uBlockOrigin/uBlock-issues/issues/1011#issuecomment-884839072

Hints for testers

  • Any filter #?# with :-abp-has() or :-abp-has-content() can be duplicated and changed to :has() and :has-text(). :-abp-has() and :-abp-has-content() remain unchanged
  • ##:has() and ##:has-text() don't work (behaviour unchanged)
  • testpages could be updated, albeit it's not backward compatible

Integration notes

  • If any validation was performed, this new allowance in the syntax might need to be taken care of.
  • Documentation should be updated.
Edited Jul 23, 2021 by Hubert Figuière
Assignee
Assign to
Time tracking