multi-account-containers
multi-account-containers copied to clipboard
Manually add URLs to a container
This PR is a repeat of PR #1688 by @sherry13131, but rebased on top of today's master.
In addition I have:
- included some small tweaks to the style tags to bring it into line with other changes made to the same block.
- cleaned up trailing whitespace on introduced code.
- fixed a latent bug in the verification code when adding a new URL.
The original code allowed any text containing any URL to be added, which I'm pretty sure would result in entries that would never be matched, so I added my own commit that trims any provided URL so that they are just http(s)://dom.ain (with any username, password, port, path, query string and/or anchor removed).
Because I've rebased the code, a number of merge commits in the original PR have vanished, but they were purely between internal development branches in the same repo, not part of the main PR.
Somebody please review and merge this! PLEEEEEEEEEEEEEEEEEEASE!
Can we get this moving again? Can I help? I have a lot of containers setup and I can't log into or use a lot of websites that do quick redirects at certain stages.
While it'd be preferable to have a proper solution like this PR, in the mean time I've resorted to generating javascript to paste into the extension's console. I've documented the steps at https://github.com/phy1729/container-config in case that's useful for you too.
This is extremely helpful, thanks for sharing
@phy1729 thank you for your hack! I use your code in this function (hope it can help others):
// open: about:devtools-toolbox?id=%40testpilot-containers&type=extension
//
// adapted from: https://github.com/phy1729/container-config
async function addUrl(container, url) {
const identities = await browser.contextualIdentities.query({ name: container });
if (identities.length > 1) throw new Error("too many container with the same name");
if (identities.length == 0) throw new Error("container not found");
const cookieStoreId = identities[0].cookieStoreId;
const userContextId = backgroundLogic.getUserContextIdFromCookieStoreId(cookieStoreId);
console.log("user context: ", userContextId);
const assignManager = window.assignManager;
await assignManager._setOrRemoveAssignment(false, url, userContextId, false);
}
To use it:
- open
about:devtools-toolbox?id=%40testpilot-containers&type=extension
- paste and run the function in the console panel
- still in the console panel call the function with the name of the container and the url to add, for example:
addUrl("search", "https://domain.to.add")
@dvd0101 Thanks for that snippet, however when I type
addUrl('Google','earth.google.com')
I get
Uncaught (in promise) `ReferenceError`: `browser` is not defined
Any idea what I need to do to make browser
accessible to the dev tools console?
(I'm using Firefox 95.0.2 on x86_64)
@kurahaupo Tested right now and the "browser" symbol is visible (FF 96b10 and the mac extension up-to-date).
Are you sure you have opened the about:devtools-toolbox?id=%40testpilot-containers&type=extension
url and pasted the code in the console of that page (not in the inspector console)?
@dvd0101 -
Are you sure you have opened the about:devtools-toolbox?id=%40testpilot-containers&type=extension URL
That was it, thanks.
Please implement this feature soon - we're dying for it :-) btw the title "Always Open This Site in..." is not correct (imho) cause most ppl will assume it will always open a link/url in a specific container, which is not the case!
Because: https://outlook.live.com/owa/[email protected] is different compared to https://outlook.live.com/owa/[email protected]
LGTM
@mozilla @ctbmozilla-admin @dannycolin PLEASE slap anyone needed to get this merged already, what's holding this off for so many years?
@mozilla @ctbmozilla-admin @dannycolin PLEASE slap anyone needed to get this merged already, what's holding this off for so many years?
Yes, for the love of god, merge this so containers is a useful extension for modern web sites!
Rebased to current main
again. (It was a clean rebase; there were no conflicting changes.)
PLEASE slap anyone needed to get this merged already, what's holding this off for so many years?
@TriMoon It won't get things to move faster. I'm pretty much the only person who contributed to anything containers lately. However, I'm not a paid staff and lack the free time to do a good review at the moment.
I can't promise anything but my University semester ends in ~1 month. Hopefully, I'll have time to look at it more closely.
@dannycolin i understand but the rest of us are unable to merge even if we would create PR's, so it's up to the ones with permissions to do it...
I can't promise anything but my University semester ends in ~1 month. Hopefully, I'll have time to look at it more closely.
Hope you had a good holiday! I know you didn't promise anything, but I'm curious if this is still on your to-do list. Totally understandable if you have more pressing things to address, but I wanted to let you guys know there's still those of us who would love this feature! Thank you for your contributions, regardless of if you're able to do this or not. Your voluntary contributions have helped many
Website redirects are causing me a lot of problems (live.com, outlook.com, microsoft.com, etc). Being able to manually add websites/URL's to the container site list would presumably solve the problem of redirects going in and out of containers.