Exempt tabs from container rechecking when they are opened from the same host #1192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now, while the exemption mechanism ensures that you can freely follow links within a domain that has been opened in a different container from the one that it has been assigned to "Always (...) Open in (...)", it does not work when you middle-click to open a link in a new tab. The result is that, for instance, when using containers to log into a website such as github with a nonstandard account while also using middle-click to open new tabs frequently, the user experience is terrible (you get redirected to the confirmation page every single time). (This is exacerbated by the confirmation page interacting badly with addons such as Tree Style Tab.)
Since, as far as I can tell, there is no compelling privacy scenario requiring that you reobtain the user's consent to use nonstandard container C when following a link on host X to open a new tab on the same host (and, as far as I can tell, this is the only class of scenarios in which originUrl and newUrl are on the same host, the active container is not standard for that host and the exemption flag is not set), I propose the following hopefully self-explanatory code fragment to make it so that requests within the same domain always go through and result in a container exemption being set for the tab.