Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per Domain Isolation Rules Wildcard process order #240

Closed
crssi opened this issue Apr 8, 2019 · 22 comments
Closed

Per Domain Isolation Rules Wildcard process order #240

crssi opened this issue Apr 8, 2019 · 22 comments

Comments

@crssi
Copy link

crssi commented Apr 8, 2019

Hi @stoically

Picture next scenario (fresh install, everything at default <- this is important):

Global Isolation -> Middle Mouse: If the clicked Link Domain does not match the active Tabs Domain (Subdomains won't get isolated)

Create two per domain isolation rules in that exact order:

  1. Domain pattern *
    Always open in new Temporary Containers: Enabled
    Mouse Clicks on Links should open new Temporary Containers [Left Mouse]: Use Global

  2. Domain pattern duckduckgo.com
    Always open in new Temporary Containers: Enabled
    Mouse Clicks on Links should open new Temporary Containers [Left Mouse]: Always

Open https://duckduckgo.com and do some search.
Left click on some results.

The second rule never fires, since the first rule wins before the second one.
Shouldn't win the rule that has stricter match?

Actual result: click on result link opens a page in the actual container
Expected result: click on a result link should open a page in a NEW container

Workaround is that the upper per domain rules are created in reverse order and we need to be careful in creating a new rules and in that case the reordering rules possibility is missing.

Cheers

@stoically
Copy link
Owner

Shouldn't win the rule that has stricter match?

You're right, that would be ideal. But I don't think it's possible to determine that reliably. I guess we need a way to reorder the rules.

@anewuser
Copy link

It could be sorted automatically with the most specific entries at the top, like this:

go.example.net
foo.example.org
sub.example.org
*.example.com
*.example.net
*.example.org
*.org
*

@stoically
Copy link
Owner

@anewuser How exactly would you approach the determining of "specific"? The only thing that comes to mind is the length of the pattern, where the shortest is the least specific, but that would fail for regexps: e.g. (example.com|example.org) would be more specific than just example.com, which doesn't make much sense to me.

@anewuser
Copy link

anewuser commented Apr 14, 2019

I didn't know that you had added support to regexes too. I was thinking only of subdomains, domains and TLDs. I'm going to use that option to keep my list more organized.

@grenzor
Copy link

grenzor commented Apr 16, 2019

Stricter matches always winning will be too subjective and not always wanted. The best way IMO to deal with priority is to allow user to reorder rules how they want and the priority of rules are in descending order of how they're ordered. That way users can make any rule with the priority they want.

@gitthehubs
Copy link

You can also do the following in global or per domain isolation, what you prefer.
Navigating in Tabs should open new Temporarly Containers: Always OR If the navigation Target Domain does not match the active Tabs Domain (Subdomains won't get isolated).

And don't use Mouse Click events.

@crssi
Copy link
Author

crssi commented Apr 16, 2019

^^ This is a recipe to break every login where login is provided by external domain.

@gitthehubs
Copy link

^^ This is a recipe to break every login where login is provided by external domain.

I thought we are talking here about duckduckgo.com :)

If you create a domain rule for duckduckgo.com, as you described in your post, and set the option as I mentioned above then every link you click on duckduckgo.com will open in a new temporary container. For me a desired operation, of course opinions can differ and it was only a suggestion showing you an different approach.

If you set the option globally you can always make domain rules for your external login domains to overrule this behaviour. Again, only showing a different approach. :)

@crssi
Copy link
Author

crssi commented Apr 16, 2019

@gitthehubs
Thank you for trying to help, but I have a working solution.
There are not only login pages, put also payments redirections.
I always seek for a basic user solution. I know we are mostly nerds here (in a good sense), but if I setup FF for my parents, there must everything be fluent with breakages at bare minimum and they are not nerds to be able to "whitelist" breakages.

If you are interested, I can share my latest solution here.

Cheers

@gitthehubs
Copy link

@crssi
Always appreciated if you want to share that!

@crssi
Copy link
Author

crssi commented Apr 17, 2019

OK. Picture the following.

DuckDuckGo as default search engine. (Set DDG in FF for default search engine and remove any other providers).
Any (left/middle) click on a search result on DDG should open a new tab in a new container named by the target domain, except when target is DDG itself (the only case when DDG suggest other buzzwords due to, for example, typo in your search query).

On any other page, left click should always stay in the same container to avoid login and payments redirection problems.

Middle click should always open a new tab in a new container, exception is when target is same domain/subdomain.

Rules:
Middle Click is your friend.
When opening a new stuff, always start with a new empty tab to contain/destroy any tracking 💩.

Useful shortcuts:
Ctrl+T (new tab)
Ctrl+W (close current tab)
Ctrl+Shift+W (undo closed tab within period of time)

Configuration (note: changes to a default settings... reinstall TC for reset to default):

General
  Automatic Mode: Check
  Container Name Prefix: %domain% #
  Random Container Color: Check
  Container Number: Reuse available numbers
  Delete no longer needed Temporary Containers: 2 minutes after the last tab in it closes
  Click [Save]
Isolation
  Per Domain
    Domain pattern: duckduckgo.com
      Always open in new Temporary Containers: Enabled
      Mouse Clicks on Links should open new Temporary Containers [Left Mouse]: If the clicked Link Domain does not match the active Tabs Domain (Subdomains won't get isolated)
      Click [Add or Edit]
    Domain pattern: *
      Always open in new Temporary Containers: Enabled
      Mouse Clicks on Links should open new Temporary Containers [Left Mouse]: Use Global
      Click [Add or Edit]
  Global
    Mouse Clicks on Links should open new Temporary Containers
      Middle Mouse: If the clicked Link Domain does not match the active Tabs Domain (Subdomains won't get isolated)
    Click [Save]
Advanced
  General
    Automatic Mode: Don't reopen New Tabs in Temporary Containers but instead on navigation.
  Click [Save]

Wildcard domain in Per domain Isolation MUST be the last (after DDG) and is needed to force opening a new tab in a new container when choosing Open Link in New Container Tab ->No Container for context menu, that is to avoid new tab being opened without container (or see it as a patch).

Wet dreams would be possibility to start a new container by typing URL in the urlbar (not to confuse with mouse clicking link event), but this cannot be achieved by underlying API limitations which does not distinguish between open link by typing into URL bar and opening by mouse event.

Useful additional web extensions:
Containerise wins over MAC due simplicity.
Context Plus for migration between containers.

Cheers

@gitthehubs
Copy link

@crssi
That is an other interesting approach, I might use a few things. Thank you very much!

@crssi
Copy link
Author

crssi commented Apr 18, 2019

@gitthehubs
I am glad you like it.
If you will have any better ideas, let me know... maybe in separate issue or perhaps at my profile to avoid spamming here (except if @stoically don't mind 😄 ).

Cheers

@crssi
Copy link
Author

crssi commented Apr 18, 2019

@stoically should I close this issue or you need it for some reminder (also feel free to close it by yourself).

Cheers and thank you for one of the best web extension.

@stoically
Copy link
Owner

Thanks! No reason to close since it's a valid and much needed feature request.

@stoically
Copy link
Owner

stoically commented Jun 29, 2019

v1.0beta7 allows reordering Per Domain Isolation rules per drag&drop. Let me know if you encounter any issues, thanks!

@crssi
Copy link
Author

crssi commented Jan 14, 2020

Wet dreams would be possibility to start a new container by typing URL in the urlbar (not to confuse with mouse clicking link event), but this cannot be achieved by underlying API limitations which does not distinguish between open link by typing into URL bar and opening by mouse event.

@stoically is there anything new to accomplish upper solution?

Thank you and wish you best in the 2020. 😄
Cheers

@stoically
Copy link
Owner

Thanks, you too.

As per Bugzilla ticket linked in #327, this isn't something that Firefox wants to support - so nothing I can do, unfortunately.

@crssi
Copy link
Author

crssi commented Jan 14, 2020

Thank you.

Sadly WONTFIX should be a new logo for mozilla products. 😢

@crssi
Copy link
Author

crssi commented Jan 14, 2020

Is it possible that they didn't understand your intentions in the ticket?

@stoically
Copy link
Owner

Judging by the answer it seems that webRequest and webNavigation are totally separate entities, and hence getting the transition type in webRequest isn't seen as feasible, which kinda makes sense. :/

@crssi
Copy link
Author

crssi commented Jan 14, 2020

I see. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants