temporary-containers icon indicating copy to clipboard operation
temporary-containers copied to clipboard

TC does not respect browser.tabs.insertRelatedAfterCurrent

Open practik opened this issue 3 years ago • 3 comments

To reproduce:

  1. Create a fresh Firefox profile and install Temporary Containers.
  2. In TC’s preferences, turn on automatic mode and set TC to open a new container whenever you click on a link to a different domain.
  3. In about:config, set browser.tabs.insertRelatedAfterCurrent to false.
  4. Open https://github.com/stoically/temporary-containers in a new tab and drag it into position 1 on the tab bar, before whatever other tabs may be open.
  5. In the Github tab, click on the link to https://addons.mozilla.org/firefox/addon/temporary-containers/, and notice that it opens in a new tab (in the same container) at the opposite end of the tab bar, after the other open tabs. This is the expected behavior, since TC is set to ignore links to AMO.
  6. Now scroll down the page and click on the link to “this long-form article” (https://medium.com/@stoically/enhance-your-privacy-in-firefox-with-temporary-containers-33925cd6cd21). Instead of opening at the end of the tab bar like the AMO tab, it opens (in a new container) in position 2, directly beside the Github tab. This is not the way things are supposed to work when browser.tabs.insertRelatedAfterCurrent is set to false.

I'm hopeful that this can be fixed, since #19 was fixable.

And most importantly: @stoically , thank you for creating this extension!

practik avatar Aug 06 '21 13:08 practik

By the way, it's probably a fluke, but I did stumble across one instance where the expected behavior actually happens under the setup I outlined above:

Open https://www.harvardmagazine.com/2000/01/code-is-law-html in tab 1 (with at least one other tab open in position 2) and then click on any of the ads on that page. A new tab flashes in and out of existence at tab position 2, and then the target URL opens in a new container in the last tab where it's supposed to open.

Watching the browser console, I can see what's different in this case. Normally (with TC in auto mode) the GET request is blocked by the extension and then replaced with a new one. But with these Harvard ads, the first thing that happens is an XHR GET request to an intermediate URL that throws a CORS error.

I'm not sure that's at all relevant to solving this issue, but I wanted to mention it just in case.

practik avatar Aug 06 '21 13:08 practik

This would require Add-ons to be able to read the browser.tabs.insertRelatedAfterCurrent configuration, which I think is not possible. Only workaround would be to make it configurable in TC itself by some sort of preference.

Happy you like the Add-on!

stoically avatar Sep 09 '21 18:09 stoically

This would require Add-ons to be able to read the browser.tabs.insertRelatedAfterCurrent configuration, which I think is not possible.

Ah, I see – too bad. Well, if you had the time and energy to implement a workaround, I'd be grateful. And if you didn't, I'd understand :-) Thanks again!

practik avatar Sep 09 '21 19:09 practik