Skip to content

Source list of entity filter with subdomain is not looked up correctly #805

@ghost

Description

Details

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

Logger details view for www.example.*##p shows "Static filter ##p could not be found in any of the currently enabled filter lists"

@okiehsch found it here: uBlockOrigin/uAssets#6637 (comment)

This started with gorhill/uBlock@a73dd0a and obviously before this commit scriptlet is not even logged.

reEntity, ^gmx\.\*$ does not match www.gmx.com in reverselookup-worker.js, hostnameMatches function.

A specific URL where the issue occurs

Steps to Reproduce

  1. add www.example.*##p to My filters
  2. open logger
  3. open http://www.example.com/
  4. click on p entry in the logger

Expected behavior:

Filter list
My filters

Actual behavior:

Filter list
Static filter ##p could not be found in any of the currently enabled filter lists

Your environment

  • uBlock Origin version: 1.23, 1.24.3b2
  • Browser Name and version: Chrome, Firefox
  • Operating System and version:

This seems to work:

diff --git a/src/js/reverselookup-worker.js b/src/js/reverselookup-worker.js
index eb12ccea..3042e5fc 100644
--- a/src/js/reverselookup-worker.js
+++ b/src/js/reverselookup-worker.js
@@ -141,8 +141,8 @@ const fromCosmeticFilter = function(details) {
     );
 
     let reEntity,
-        domain = details.domain,
-        pos = domain.indexOf('.');
+        domain = details.hostname,
+        pos = domain.lastIndexOf('.');
     if ( pos !== -1 ) {
         reEntity = new RegExp(
             '^' +

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedissue has been addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions