stoically / temporary-containers

Firefox Add-on that lets you open automatically managed disposable containers
https://addons.mozilla.org/firefox/addon/temporary-containers/
MIT License
852 stars 60 forks source link

[Feature suggest] Isolation -> comma separated domain patterns #418

Open crssi opened 4 years ago

crssi commented 4 years ago

Hi @stoically

  1. Could you extend the Domain Pattern in the Isolation -> Per Domain to accept comma separated multiple domains.
  2. Could you add just under Domain Pattern the comma separated list of excepted domains of the Domain Pattern.

For example: I would always like to open google.*, its subdomain and youtube.com in a new container (<- where trailing * means TLD, like goole.com, google.co.uk...) But not when Target domain is accounts.google.com or accounts.youtube.com

So the config should say: Domain Pattern = google.*, *.google.*, youtube.com, *.youtube.com Domain Pattern Exception = accounts.google.com, accounts.youtube.com

Cheers

stoically commented 4 years ago

Sounds like a good suggestion, I think #397 would cover that pretty good as well. A workaround to get that behavior now would be a regexp pattern like this (these also work for exclusion patterns):

/https?://(.+\.)?google\.([^.]+|co\.uk)($|/.*)/

(the co.uk is needed for TLDs with dots in them, so everything without dots like .com is covered)

If I can help with regexp, let me know - could also hop into #tmp:mozilla.org :D

crssi commented 4 years ago

The regex is not a problem. ATM I have /^https?:\/\/(?=(.+\.)?(google|youtube)\.([^.]+|co\.uk)\/)((?!accounts\.?(google|youtube)\.([^.]+|co\.uk)\/)).*$/. But is not really good TLD solution... and Regex is complicated and eye hurting. 😉