Won't block 3rd party properly
-
@SweetP Might be a WebKit limitation sadly
If it turns out that the feature cannot be implemented, maybe it’s a better UI to have just the base domain be added when you click the +exception even if you are on a subdomain, since this would be the expected behavior. What do you think?
-
@SweetP Ok, so from what I could tell of the way Minim is writing its ruleset, the trigger “if-domain” with the wildcard * seems to make the root domain + all subdomains whitelist appear.
As per Apple’s docs, "if-domain | An array of strings to match to a URL's domain; limits the action to a list of specific domains. The values must be lowercase ASCII, or Punycode for non-ASCII. Add * in front to match domain and subdomains. You can't use this with unless-domain.”Would this mean that having Minim just add the if-domain without the wildcard * in front work as expected (i.e. to block just that specific subdomain) ?
This way, the user could either add * in front if he/she wants to block the root domain and be done with it or have more granular control by default.
Of course, there could be a small UI element (like a checkmark/asterisk icon or something similar) in front when adding a wildcard exception to the Minim list.
Would this work/be reasonable?
-
ok so Ive worked on this a little this morning.
and I have changed the default behaviour in Minim to only block the urls listed.
subdomains will be unaffected by rules.After lunch ill take a look add adding in support for the use of the
*
wild card prefix to also block all subdomains.These changes have the added benefit of speeding up url matching, which should improve performance
-
@SweetP said in Won't block 3rd party properly:
Also, currently domains with a wildcard will override subdomain rules…
I’ll see if there’s anything I can do about thatI would think this to the expected behaviour. Once the user adds a wildcard root domain all subdomain rules should be ignored.
It would be great if the ruleset would automatically be pruned once the user whitelists the root domain with the wildcard, but that’s a nice to have mostly. -
@SweetP Something seems to be wrong. The update just hit a moment ago and Minim seems to be blocking everything by default and ignores the Block Rules tab. Regardless of the options in Block Rules tab, the only rules written are the default
{ "trigger" : { "url-filter" : ".*" }, "action" : { "type" : "ignore-previous-rules" } }, { "trigger" : { "url-filter" : ".*" }, "action" : { "type" : "block" } },
I think the resource-type trigger field is missing from the default block rules and just the action (i.e. block) is being generated, thus blocking every URL.
-
@SweetP Update just hit. Seems to work well, except for a small issue with the way www and non-www domains get handled.
If you go to www.google.com and add an exception for it, Minim’s list will have google.com without the www part
This means that with the current behaviour it won’t load resources unless the user manually fixes the exceptions list and adds the www back.I think the regex for www matching is broken because of the extra escape char \ after www:
^https?:\/\/(www\\.)?google.com[:\/]
-
Also, if you completely unblock all resources for www.google.com, since no other "url-filter" rules gets generated and only the default "unless-domain” google.com gets added (without www part) the exception won’t apply.
I think the default behaviour of stripping the www part when adding an exception to Minim is no longer valid with this new better handling of domain/subdomain separation. In essence, www is a subdomain and should be treated as such.
-
@NickC said in Won't block 3rd party properly:
I think the default behaviour of stripping the www part when adding an exception to Minim is no longer valid with this new better handling of domain/subdomain separation. In essence, www is a subdomain and should be treated as such.
Ill look into this
as im also doing some www assumptions elsewhere in code.
but good points