uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
945 stars 81 forks source link

Sort dynamic filter list by destination / host components #1055

Closed Mathnerd314 closed 4 years ago

Mathnerd314 commented 4 years ago

Prerequisites

Description

I can't speak for anyone else's dynamic rule list, but in my list most rules are sub-hosts where the destination is specific to the origin, and the rest are CDN's like jsdelivr. Sorting by destination allows finding the CDN's, while the current sort (by origin) does not seem to aid anything besides erasing a site.

Also, for subdomains, the current sort is just alphanumeric. It should group domains like a.x.com and b.x.com, to aid in creating rules for the top domain.

A specific URL where the issue occurs

Chase.com is a big site that provides an example. To allow it to work in uBlock Medium Mode (+ a global rule blocking inline/first-party scripts) I've created the following rules:

personal.chase.com chase.com * noop
...
secure04b.chase.com chase.com * noop
secure04b.chase.com chasecdn.com * noop
secure06b.chase.com chase.com * noop
secure06b.chase.com chasecdn.com * noop
secure07b.chase.com chase.com * noop
secure07b.chase.com chasecdn.com * noop
...
www.chase.com chase.com * noop
www.chase.com chasecdn.com * noop

Clearly there is a lot of duplication here. Without sorting it by the destination, or at least by hostname components in the source, these are all scattered throughout the filter list. And if I see the secure* hosts and add rules for the top domains,

chase.com chase.com * noop
chase.com chasecdn.com * noop

Then there is no warning or anything that will remove the now-useless other rules like for personal.chase.com.

Another case is domains like cdn.jsdelivr.net.cdn.cloudflare.net, because they are used on many completely unrelated websites. You wouldn't be able to find the shared CDN's for possible whitelisting without a good memory or the requested sort.

Steps to Reproduce

  1. Add a lot of dynamic filter rules
  2. Try to look at them and find redundancies

Expected behavior:

Sort by destination and source domains with an intelligent sort or Some extension of the filter tool to allow selecting a sort by destination

Actual behavior:

Give up in frustration and import the list into a spreadsheet program just to sort it

Your environment

gwarser commented 4 years ago

See also https://github.com/gorhill/uBlock/issues/571

uBlock-user commented 4 years ago

Try to look at them and find redundancies

You know you can filter out the rules and then look for that.

Mathnerd314 commented 4 years ago

You know you can filter out the rules and then look for that.

I guess, but entering in 1240 different domains into the search box would take a while, probably more time than it would for me to implement this.

gorhill commented 4 years ago

I still need to add localized strings for the new sort widget.