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

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

Open
justrhysism opened this issue Nov 6, 2019 · 7 comments
Open
Labels
👍 Feature Request Feature requests users would like to see in this addon

Comments

@justrhysism
Copy link

justrhysism commented Nov 6, 2019

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

@richardkmichael
Copy link

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

@rolandd
Copy link

rolandd commented May 30, 2020

+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.

@gkaklas
Copy link

gkaklas commented Jun 20, 2020

@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

@dannycolin dannycolin added 👍 Feature Request Feature requests users would like to see in this addon and removed enhancement labels May 20, 2022
@nitrocode
Copy link

Seems like the full URL is stored in the browser

async _setOrRemoveAssignment(tabId, pageUrl, userContextId, remove) {

await this.storageArea.set(pageUrl, {
userContextId,
neverAsk: false
}, exemptedTabIds);

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

getSiteStoreKey(pageUrlorUrlKey) {
if (pageUrlorUrlKey.includes("siteContainerMap@@_")) return pageUrlorUrlKey;
const url = new window.URL(pageUrlorUrlKey);
const storagePrefix = "siteContainerMap@@_";
if (url.port === "80" || url.port === "443") {
return `${storagePrefix}${url.hostname}`;
} else {
return `${storagePrefix}${url.hostname}${url.port}`;
}

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

@mejo-
Copy link

mejo- commented Nov 2, 2023

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.

@rjt
Copy link

rjt commented Apr 2, 2024

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

@achernyakevich-sc
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👍 Feature Request Feature requests users would like to see in this addon
Projects
None yet
Development

No branches or pull requests

10 participants