kintesh / containerise

Firefox extension to automatically open websites in a container
MIT License
408 stars 54 forks source link

Domains in the address that are not the top level domain break behavior #188

Closed goose-ws closed 10 months ago

goose-ws commented 10 months ago

I have two containers with the following regex patterns:

Google:
!*.google.com

Amazon:
!*.amazon.com

I wanted to set up some filters in my G-Mail to automatically process emails from Amazon. In the process of doing so, it invokes the URL:

https://mail.google.com/mail/u/0/#create-filter/from=shipment-tracking%2540amazon.com

Because amazon.com is in the URL, the tab closes and relaunches in the Amazon container. This should not be the expected behavior, however. I would argue that for Basic Matching and Glob items, the pattern should only be matched on the host domain, which could be reasonably extracted by some regex that trims the protocol ^((s)?ftp|http(s)?)://, and then everything to the first leading slash /.*$. Or some solution like that?

AlexVallat commented 10 months ago

In the add-on options there is a switch to "Match domain only". If you turn this on you'll get the behaviour you want.

If you need to set this on a per-rule basis then your best bet is to use a regex, so instead of !*.google.com try @https?://([^/]*.)?google.com

goose-ws commented 10 months ago

Ah, I didn't think to check for options from the add on menu, just thought they could be set from the extension itself. Thanks for the tip!