Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
A
adblockpluscore
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 85
    • Issues 85
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 7
    • Merge Requests 7
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • eyeo
  • adblockplus
  • adblockpluscore
  • Issues
  • #111

Closed
Open
Opened Dec 18, 2019 by Amr Makram@amakram☮Guest

Unexpected behaviour when using a * as TLD in snippet filters

Environment

  • OS version: Windows 10
  • Browser version: Chrome 81.0.4000.2 (Official Build) canary (64-bit)
  • Extension version: ABP 3.7 (stable)
  • Last working version: Not sure

How to reproduce

  1. Open Advanced tab in desktop settings page
  2. Add the filter example.*#$#abort-on-property-read matchMedia to custom filters
  3. Refresh the page and go to the advanced tab
  4. Add the missing space (before parameter) back

Observed behavior

  1. After 2) two filters are added instead of one, the original filter plus another filter without the space before the parameter (see first screenshot)
  2. After 3) There is one filter, not the original one added, but one without the space before parameter (see second screenshot)
  3. After 4) the filter disappears

Expected behavior

Filter is either added exactly as it is (only once), or rejected

Further information

I'm not sure if * is supported as TLD in snippet filters, but they seem not.

Screenshots:

image

image

Integration notes

Element hiding filters, element hiding emulation filters, element hiding exceptions, and snippet filters may now contain a * in the domains part of the filter text as specified in the proposal in #111 (comment 269757932).

In order to address the issue from the UI perspective, eyeo/adblockplus/adblockpluschrome> must examine the domains property of the ActiveFilter object to look for any invalid domains using the new isValidHostname() function from lib/url.js and report the error/warning to the UI as appropriate. For example, if the change is made to the parseFilter() function in lib/filterConfiguration.js, the final code might look something like this:

let filter = Filter.fromText(text);
if (filter instanceof InvalidFilter)
{
  error = new FilterError("invalid_filter", filter.reason);
}
else if (filter instanceof ActiveFilter)
{
  for (let [domain] of filter.domains)
  {
    if (!isValidHostname(domain))
    {
      error = new FilterError("invalid_domain", domain);
      break;
    }
  }
}

return [filter, error];

/label bug

Edited Jan 21, 2020 by Manish Jethani
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: eyeo/adblockplus/adblockpluscore#111