multi-account-containers icon indicating copy to clipboard operation
multi-account-containers copied to clipboard

[Feature Request] "Always open in" configurable using domain + path

Open justrhysism opened this issue 6 years ago • 7 comments
trafficstars

Actual behavior

Setting "Always open in" for a particular site defaults to the entire domain, e.g. setting for https://dev.azure.com/MyCompany/ sets the entire domain of https://dev.azure.com/ to use that container.

Requested behavior

For those of us who manage multiple logins for multiple organizations, it would be awesome if we could (optionally) include the path to determine which container:

e.g.

https://dev.azure.com/MyCompany/ => My Company Container https://dev.azure.com/OtherCompany/ => Other Company Container

justrhysism avatar Nov 06 '19 02:11 justrhysism

FWIW, I believe this fork has a similar feature. I have not tried it.

richardkmichael avatar Jan 15 '20 18:01 richardkmichael

+1 on this request - I have one different but very specific use case. Right now I have "nytimes.com" sites set to open in a "news" container and "thewirecutter.com" set to open in my shopping container. Unfortunately NYT recently changed the wirecutter to redirect to https://www.nytimes.com/wirecutter/ so if I go to "thewirecutter.com" then it ends up open in my news container (which is not logged into my shopping accounts etc). It would be ideal if I could say any pages matching "nytimes.com/wirecutter" get opened in shopping, otherwise anything matching nytimes.com goes into news.

rolandd avatar May 30 '20 23:05 rolandd

@justrhysism I believe this seems like a duplicate of #473 and/or #691 🤔 If this is the case, I believe it is ok to close this

gkaklas avatar Jun 20 '20 15:06 gkaklas

Seems like the full URL is stored in the browser

https://github.com/mozilla/multi-account-containers/blob/0bcac2a7417c0876c347e90999103c14cbf6b5c4/src/js/background/assignManager.js#L574

https://github.com/mozilla/multi-account-containers/blob/0bcac2a7417c0876c347e90999103c14cbf6b5c4/src/js/background/assignManager.js#L596-L599

But when it's retrieved, only the host name and the port is used.

https://github.com/mozilla/multi-account-containers/blob/0bcac2a7417c0876c347e90999103c14cbf6b5c4/src/js/background/assignManager.js#L12-L20

This might be one of the code changes needed

  if (url.port === "80" || url.port === "443") {
-    return `${storagePrefix}${url.hostname}`;
+    return `${storagePrefix}${url.hostname}${url.pathname}`; 
  } else {
-    return `${storagePrefix}${url.hostname}${url.port}`; 
+    return `${storagePrefix}${url.hostname}${url.port}${url.pathname}`; 
  } 

https://developer.mozilla.org/en-US/docs/Web/API/URL

It would be more work to make it configurable in case some users wanted to use just the hostname (current) or both hostname and path

nitrocode avatar Feb 14 '23 14:02 nitrocode

This would be incredibly helpful e.g. for Github/Gitlab if you use different handles for different projects. github.com/projectA would open in one container and github.com/projectB in another.

mejo- avatar Nov 02 '23 09:11 mejo-

Trying to understand here, was there a strong developer reason to not use the pathname of the url?

rjt avatar Apr 02 '24 06:04 rjt

@rjt Probably problem is not laying in these line (though if I properly remember url.pathname was not available in early versions of Firefox API). :)

As soon as you introduce support of path name you will need to add its support in the URL assignment UI and whole UX. And it is not only one editor but it will touch almost all visual part of MAC add-on. Be sure that it is a quite big bunch of work that could cause add-on instability. As this add-on is Open Source and is maintained by volunteers I could not expect that these guys have so much free time for it.

achernyakevich-sc avatar Apr 02 '24 06:04 achernyakevich-sc