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: Open bookmark in [container] (talk to the (integrate the contextualIdentities api) #32

Open
v00p opened this issue Apr 10, 2018 · 8 comments
Labels
for later consideration Request kept open for later consideration

Comments

@v00p
Copy link

v00p commented Apr 10, 2018

Being able to Open bookmark in any specified container has been made possible since march 13th of this years. The official Mozilla Firefox Container addons itself haven't yet integrated this capability however.
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextualIdentities

@aaFn
Copy link
Owner

aaFn commented Apr 10, 2018

Hello @v00p , interesting, I didn't know that, thank you. However, there is a problem:

From Firefox 57 onwards, if an extension that uses the contextualIdentities API is installed,
then the contextual identities feature will be enabled automatically.

This means that if I include the "contextualIdentities" permission in my add-on to be able to propose the option in the contextual menu, it will force the add-on users to have this function activated, and exposed to it without any preparation.
And maybe force them to specifically disable it if they do not want it.

That is clearly an undesirable effect. Too bad they made that choice in FF API design.
And I have no way to conditionally activate that API depending on whether the user already activated it or not, since this is a static setting in the manifest.json file .. if there, it activates the feature.

Therefore, we should wait for the functionality to be present officially in normal FF builds.

Meanwhile, I suggest that people who want to use it simply open a new Window or new tab using the File menu as explained in https://wiki.mozilla.org/Security/Contextual_Identity_Project/Containers, and then use the add-on within it.
Not ideal, but should be functional .. to live with until FF officially expose the function to all its user base.

Let me know your thoughts.

@v00p
Copy link
Author

v00p commented Apr 27, 2018

@aaFn I agree. And this feature is so rarely updated, I don't expect them to add this functionnality anytime soon.. One way would be to branch your current extension in two versions. The "non-Container-ready" version (current), and a (new) "Container-ready" one..
I can't figure much any way/workaround for any extension developpers to integrate this contextual identity api, without recurring to such version branching annoyance..

I wonder if the browser.contextualIdentities.query function alone require that "contextualIdentities" permission ...

@aaFn
Copy link
Owner

aaFn commented Apr 28, 2018

Hello @v00p , it looks like yes, it needs it.

I also did a little more digging, there is a flaw in that API: it can just manipulate (= create, delete, change) a contextual identity .. but an add-on is not able to select the current contextual identity through that API (or any other as I could see).

Therefore, for an add-on like BSP2 which had to recreate a UI in the sidebar, building its own context menus for opening bookmarks in new tabs or in new windows, (for example), there won't be a way to specify which contextual identity to use.

The only way will be through the File menu and native FF actions, until the selection capability is added to the API .. :-(

Or let me know if you ever see a way to do that.

@aaFn aaFn added the for later consideration Request kept open for later consideration label May 6, 2018
@v00p
Copy link
Author

v00p commented May 6, 2018

Hi @aaFn
I'm not 100% sure of that, but I believe that even the current container feature of the browser doesn't handle that on it's own. Containers in FF can be run with or without a container management extension.
There is currently only one such extension that I know of, and it's Mozilla Multi-Account Container .. I think this is that extension alone that handle the redirection to proper Container

@aaFn
Copy link
Owner

aaFn commented May 6, 2018

Hello @v00p,
thanks for the link, very useful.

I looked at the code and I believe I now get an idea of how they open tabs in specific container.
In fact, a container is specfied by its specific cookie store it appears ...

So opening a link in another container is a matter of calling
browser.tabs.create()
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/create

with the specific cookieStoreId: as retrieved from
browser.cookies.getAllCookieStores()
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/cookies/getAllCookieStores
and
browser.contextualIdentities.query()
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/contextualIdentities/query

This seems to confirm it: Infocatcher/Private_Tab#254
if I interpret well ..

Next should be to wait that this becomes mainline, and then I can include it in BSP2.

@v00p
Copy link
Author

v00p commented May 7, 2018

@aaFn Good stuff. Can't wait someone sort this out ;)
Also, if that can be of any further help. Here's a google little graph to know what container isolate and don't:

Container segregation
src: https://blog.mozilla.org/tanvi/2016/06/16/contextual-identities-on-the-web/

@april4
Copy link

april4 commented Jan 9, 2020

Very expected this feature got implemented.

@aaFn
Copy link
Owner

aaFn commented Jan 12, 2020

Hello @april4 , ok. This is still not yet mainstream in FF, so still waiting for FF to formally publish the function to enable it .. unless I can find a way to not force it to activate when the user did not activate it by himself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for later consideration Request kept open for later consideration
Projects
None yet
Development

No branches or pull requests

3 participants