Bug 1191418 (ContextualIdentity)

[META] Contextual Identity / Containers Bugs

NEW
Unassigned

Status

()

4 years ago
10 days ago

People

(Reporter: englehardt, Unassigned)

Tracking

(Depends on: 128 bugs, Blocks: 1 bug, {feature, meta})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 obsolete attachment)

(Reporter)

Description

4 years ago
The Contextual Identity Project (see: https://wiki.mozilla.org/Security/Contextual_Identity_Project/Containers) aims to add lightweight containers/profiles into the browser to give users the ability to segregate their local state (cookies, localStorage, etc) based on the context they are browsing in.

Example uses cases:
* User has multiple accounts on websites and wants to be logged into both simultaneously.  One in a personal context, the other in a work context.
* User wants a session that persists but doesn't leak information to trackers about their browsing behavior in other contexts.  (Ex: doesn't want the shopping context to affect the ads they see in their work context.
* A user wants to remain logged into a social network without being tracked across the web

This meta-bug is a collection of the related bugs supporting this project.
(Reporter)

Updated

4 years ago
Depends on: 1181953, 1179557, 1179985
(Reporter)

Updated

4 years ago
Depends on: 1191442
(Reporter)

Updated

4 years ago
Depends on: 1191451
(Reporter)

Updated

4 years ago
Depends on: 1191455
(Reporter)

Updated

4 years ago
Depends on: 1191460
(Reporter)

Updated

4 years ago
Depends on: 1191494

Updated

4 years ago
Depends on: 1193854
(Reporter)

Updated

4 years ago
Depends on: 1195881
(Reporter)

Updated

4 years ago
Depends on: 1199466
(Reporter)

Updated

4 years ago
Depends on: 1199470
(Reporter)

Updated

4 years ago
Depends on: 1199471

Updated

4 years ago
Alias: ContextualIdentity

Updated

4 years ago
Depends on: 1211716

Comment 1

4 years ago
How about setting usercontext on bookmarks?

Updated

4 years ago
Depends on: 1213290

Comment 2

3 years ago
You can look at the https://getmultifox.com/ extension as example how this works - it provide per-tab select identity (cookie and session storage) for users.
But Multifox Firefox extension will stop working after Firefox remove XPCOM support, and seems there are no ways to provide this feature via new Firefox WebExtensions API, so build-in contextual identity will be useful feature!

Comment 3

3 years ago
I see that "Image Cache" is not separated by this, but a lot of tracking is done with images. Wouldn't this leak info across contexts?
(In reply to donrhummy from comment #3)
> I see that "Image Cache" is not separated by this, but a lot of tracking is
> done with images. Wouldn't this leak info across contexts?

Image Cache should be separated in the same way Necko Cache is.  Is that not the case it our current implementation?  Huseby, can you check on this and file a bug if needed?  This may be a Desktop only issue.
Flags: needinfo?(huseby)

Updated

3 years ago
Depends on: 1234672
Depends on: 1237364
I'll check it out.
Flags: needinfo?(huseby)
Depends on: 1238766

Updated

3 years ago
Depends on: 1240243
Depends on: 1240094
Depends on: 1244340
Depends on: 1244795
Depends on: 1244887
Depends on: 1245124
Depends on: 1245184
Depends on: 1245262

Comment 6

3 years ago
It seems like people are starting to look into implementing this.  Exciting!

I think we need to handle many of the places in the code where we store data on disk related to the user's browsing.  One example is cookies.  It's probably a good idea to have a consistent model everywhere.

I think the right approach should be for the user context ID to be stored alongside the data (perhaps encoded in the origin string) and in code using the data read from the disk we should be careful to not read another user's data, nor modify/delete them.  This basically gives us a solid virtual per-user-context-ID container for the stored data.

Finding all of the necessary call sites to audit and handle can be daunting.  I think a good starting point would be places where we check the private browsing mode, since a lot of them map to code that wants to store something about the user's browsing to disk, so that should find many of the places we need to fix, and we have covered almost all of those places over the years.

Not sure how much this matches the current thinking, and/or who to direct this too.  Andrea, do you know?  Thanks!
Flags: needinfo?(amarchesini)
> Not sure how much this matches the current thinking, and/or who to direct
> this too.  Andrea, do you know?  Thanks!

Absolutely. We are doing that using OriginAttributes everywhere. It's a big task but it has been almost fully done.
There are plenty dependences here and many depending bugs are metabugs: bug 1197283, 1153435, etc.
Cookies, localStorage, IDB, quota, all of this is already fully managed and it works.
If you are interested or you have specific questions, we have a weekly meeting on Wednesday.
I'll ping you tomorrow on IRC to tell you more :)
Flags: needinfo?(amarchesini)
Depends on: 1245502

Updated

3 years ago
No longer depends on: 1245184

Updated

3 years ago
Depends on: 1245184
Depends on: 1246907
Depends on: 1247517
Depends on: 1248251
Depends on: 1248302
Depends on: 1248639
Depends on: 1249224
Depends on: 1249348
Depends on: 1253006
Depends on: 1253538
Depends on: 1254103
Depends on: 1259169
Depends on: 1260535
Depends on: 1260766

Updated

3 years ago
Keywords: feature, meta
Depends on: 1267538
Depends on: 1267916
Depends on: 1267920
Depends on: 1267921
Depends on: 1267922
Depends on: 1267923
Depends on: 1264556
Depends on: 1264562
Depends on: 1268726
Depends on: 1264571
Depends on: 1264564

Updated

3 years ago
Depends on: 1269029

Updated

3 years ago
Depends on: 1146401
Depends on: 1270471

Updated

3 years ago
Depends on: 962365

Updated

3 years ago
Blocks: 962374

Updated

3 years ago
Depends on: 1268803

Updated

3 years ago
Depends on: 1270678

Updated

3 years ago
Depends on: 1270679

Updated

3 years ago
Depends on: 1270680

Updated

3 years ago
Depends on: 1270681

Updated

3 years ago
Depends on: 1270683
Depends on: 1271516
Depends on: 1271792
Depends on: 1272043
Depends on: 1272067
Depends on: 1272256
Depends on: 1272466
Depends on: 1272754
Depends on: 1273215

Updated

3 years ago
Depends on: 1249067
Depends on: 1274211
Depends on: 1274246
Depends on: 1274461
Depends on: 1274567

Updated

3 years ago
Depends on: 1275432
Depends on: 1275485

Comment 8

3 years ago
Is there some documentation for addon developers? The container concept is awesome, but the default UI for containers does not reflect how I would like to use it.
Depends on: 1276002

Updated

3 years ago
Depends on: 1276412
(In reply to The 8472 from comment #8)
> Is there some documentation for addon developers? The container concept is
> awesome, but the default UI for containers does not reflect how I would like
> to use it.

We don't have much documentation yet, just https://wiki.mozilla.org/Security/Contextual_Identity_Project/Containers.  If you are looking for something like Containers with different UI, you probably want documentation about OriginAttributes.  But OriginAttributes are fairly new, so I'm not sure there is documentation on that yet either.

What would you like to do in your addon?
Flags: needinfo?(bugzilla.mozilla.org)

Comment 10

3 years ago
(In reply to Tanvi Vyas - behind on reviews [:tanvi] from comment #9)
> What would you like to do in your addon?

a) ability to dynamically create or destroy new containers
b) assign the container on tab navigation / opening tabs
c) assign a different container to sandboxed iframes

The idea is to automatically compartmentalize things based on origin wherever reasonable.

Let's say I have the following tabs open + embedded 3rd-party content:

- a forum, turns posted links to youtube into embeds
- a blog, requires recaptcha for anonymous comments
- Youtube
- Gmail
- Google


Google, Youtube, Gmail shouldn't have to share logins or cookies even though they all load stuff from google. And since I don't want to make a conscious effort of opening google or youtube videos in the "correct" container it should determine that based on the page URL.

For the YT embed iframes I would like to choose whether they load with an anonymous container (spawned and destroyed on demand) or with my YT account.

And recaptcha needs to build some reputation if you don't want to get those terrible inkblots, so you can't just block cookies, but it doesn't need to associate my blog comment activity with my google account. Or with other sites also using recaptcha for that matter.
Flags: needinfo?(bugzilla.mozilla.org)
Depends on: 1276877
Depends on: 1276880
Depends on: 1276904

Updated

3 years ago
Depends on: 1277570
Depends on: 1277765
No longer depends on: 1277570

Updated

3 years ago
Depends on: 1279029
Depends on: 1279099
Depends on: 1279140
Depends on: 1279143

Updated

3 years ago
Depends on: 1278177
Depends on: 1279271
Depends on: 1279297

Updated

3 years ago
Depends on: 1279337

Updated

3 years ago
Depends on: 1279103
Depends on: 1279568
Depends on: 1279622

Updated

3 years ago
Depends on: 1280253

Updated

3 years ago
Depends on: 1280333
Depends on: 1280497
Depends on: 1280863
Feature Request:
One useful feature would be to have the option to have a window be "sticky" about the context it's using, so that new tabs would automatically use a given context. I know that links from tabs in a given context stay within that context, but opening up new tabs (using the "+" or the keyboard shortcuts) open in the original, default context.
Depends on: 1282279

Updated

3 years ago
Depends on: 1283314

Updated

3 years ago
Depends on: 1283319

Updated

3 years ago
Depends on: 1283320

Updated

3 years ago
Depends on: 1283325
Depends on: 1283377

Updated

3 years ago
Depends on: 1283491

Updated

3 years ago
Depends on: 1283495

Updated

3 years ago
Depends on: 1280697
Depends on: 1283709

Comment 12

3 years ago
(In reply to JR Conlin [:jrconlin,:jconlin] from comment #11)
> One useful feature would be to have the option to have a window be "sticky"
> about the context it's using, so that new tabs would automatically use a
> given context.

I.e., a re-implementation of profiles, but without the separation of UI that profiles provide. If this is going to be the way of the future, I'd at least like to see the ability to separate bookmarks as well - when I go into work mode, I want to streamline away all the personal bookmarks I have and concentrate on those that are relevant to the work I'm doing. I use profiles and the bookmarks toolbar extensively to be able to get to common tasks quickly in whichever context I'm working. As I work for three different companies in addition to my freelancing and personal stuff, I consider profiles to be a much better solution, but if they're going away (bug #214675) Containers had better allow me to concentrate on one context at once instead of mixing them.
(In reply to Iain Hallam from comment #12)
> (In reply to JR Conlin [:jrconlin,:jconlin] from comment #11)
> > One useful feature would be to have the option to have a window be "sticky"
> > about the context it's using, so that new tabs would automatically use a
> > given context.
> 
> I.e., a re-implementation of profiles, but without the separation of UI that
> profiles provide. If this is going to be the way of the future, I'd at least
> like to see the ability to separate bookmarks as well - when I go into work
> mode, I want to streamline away all the personal bookmarks I have and
> concentrate on those that are relevant to the work I'm doing. I use profiles
> and the bookmarks toolbar extensively to be able to get to common tasks
> quickly in whichever context I'm working. As I work for three different
> companies in addition to my freelancing and personal stuff, I consider
> profiles to be a much better solution, but if they're going away (bug
> #214675) Containers had better allow me to concentrate on one context at
> once instead of mixing them.

Containers are not meant to replace profiles.  Profiles are great and have their own set of uses cases.  Containers is for a different use case, where a separate profile feels to heavy weight for the task at hand.
Depends on: 1284985
Depends on: 1285513
Depends on: 1285515
Depends on: 1285518

Updated

3 years ago
Depends on: 1285677
Depends on: 1285853
Depends on: 1286357

Updated

3 years ago
Depends on: 1287001
Depends on: 1287765
Depends on: 1287879
Depends on: 1288029
Depends on: 1288057

Updated

3 years ago
Depends on: 1288504

Updated

3 years ago
Depends on: 1288858

Updated

3 years ago
Depends on: 1289130

Updated

3 years ago
Depends on: 1289131
Depends on: 1289571
Depends on: 1289832

Updated

3 years ago
No longer depends on: 1280590
Depends on: 1291521
Depends on: 1291524
Depends on: 1291672
Depends on: 1292241
Depends on: 1294336
Depends on: 1294786

Updated

3 years ago
Depends on: 1294866
Depends on: 1295750
Depends on: 1297477
No longer depends on: 1297477
Depends on: 1297738
Depends on: 1299480
No longer blocks: 962374
Depends on: 1301430
Depends on: 1301523

Updated

3 years ago
Blocks: 1301617
No longer blocks: 1301617
Depends on: 1301617
Depends on: 1302088
Depends on: 1302566

Updated

3 years ago
Depends on: 1302697

Updated

3 years ago
Depends on: 1302157

Updated

3 years ago
Depends on: 1302597
Depends on: 1289001

Updated

3 years ago
Depends on: 1280590
Depends on: 1303911

Updated

3 years ago
Blocks: 1304875
Depends on: 1305280
Depends on: 1305592
Depends on: 1306684
Depends on: 1306975
Depends on: 1309067
Depends on: 1310276
Depends on: 1310601
Depends on: 1311845
Depends on: 1315055
Depends on: 1315673

Updated

2 years ago
Depends on: 1316283

Updated

2 years ago
Depends on: 1316359
Depends on: 1316727
Depends on: 1316740
Depends on: 1316742
Depends on: 1316744
Depends on: 1316747
Depends on: 1316919
Depends on: 1317138
Depends on: 1317317
Depends on: 1317544

Updated

2 years ago
Depends on: 1317927
Depends on: 1318491

Comment 14

2 years ago
Containers works very well on Firefox 52 and 53 versions and very useful, thanks for this improvement! I fully switched to it from Multifox extension, and will be glad to see on stable versions.

But I miss feature to change container of already opened tab - this is unavailable in tab context menu, and via click on container icon in Location bar too :(

Please add switching container for current opened page in tab to Right-click menu on tab and to click on container icon in Location bar. Thanks!
Depends on: 1319045

Updated

2 years ago
Depends on: 1318352
Depends on: 1319346
Depends on: 1318652
Depends on: 1319929
Depends on: 1303366
Depends on: 1320355
Depends on: 1320368
Depends on: 1320376
Depends on: 1320378
Depends on: 1320041
Depends on: 1320757
No longer depends on: 1320376
Depends on: 1317185

Comment 15

2 years ago
Also "Open in Container tab" menuitem missed on bookmark items, please add in this place too.

Updated

2 years ago
Depends on: 1321914
Depends on: 1322387
Depends on: 1322856
Depends on: 1317182

Updated

2 years ago
Depends on: 1323873
Depends on: 1324551

Updated

2 years ago
Depends on: 1325014

Updated

2 years ago
Depends on: 1312954

Updated

2 years ago
Depends on: 1324115
Depends on: 1325505

Comment 16

2 years ago
(In reply to Murz from comment #14)
> Containers works very well on Firefox 52 and 53 versions and very useful,
> thanks for this improvement! I fully switched to it from Multifox extension,
> and will be glad to see on stable versions.
> 
> But I miss feature to change container of already opened tab - this is
> unavailable in tab context menu, and via click on container icon in Location
> bar too :(
> 
> Please add switching container for current opened page in tab to Right-click
> menu on tab and to click on container icon in Location bar. Thanks!

I agree. The main usability issue with Containers right now is that there is currently no way to change the context of the current tab, which is supported in other implementations (Multifox, etc.)
Depends on: 1325874
Depends on: 1325886
Depends on: 1325902
Depends on: 1326087
Depends on: 1326058
Depends on: 1328246

Updated

2 years ago
Depends on: 1328756
Depends on: 1328935

Updated

2 years ago
Depends on: 1329411

Updated

2 years ago
Depends on: 1329453

Updated

2 years ago
Depends on: 1329456
Depends on: 1330745

Updated

2 years ago
Depends on: 1331595
Depends on: 1333214
Depends on: 1333395

Updated

2 years ago
Depends on: 1334013
Depends on: 1334587
Depends on: 1334722
Depends on: 1335678
Depends on: 1335706
Depends on: 1337937

Comment 17

2 years ago
Developers, can you provide example how we can change Container for current tab in custom script/extension via WebExtensions API or other way? Thanks
https://github.com/mdn/webextensions-examples/tree/master/contextual-identities << you can reload tab using cookieStoreId prop.
https://blog.mozilla.org/addons/2016/11/18/webextensions-in-firefox-52/

Btw, browser.contextualIdentities and browser.devtools API is still missing on https://developer.mozilla.org/en-US/Add-ons/WebExtensions, any new or experimental API should be listed there, if not a complete description of it (because they are still creating), at least with links to some other place with partial description.

Updated

2 years ago
Depends on: 1338505
Depends on: 1338735
Depends on: 1340450
Depends on: 1342803
Depends on: 1344231
Depends on: 1334696
Depends on: 1345643
Depends on: 1340993
Depends on: 1346434
Depends on: 1346653
Depends on: 1347604
Depends on: 1351155
Depends on: 1355433
Depends on: 1357399
Depends on: 1357450
Depends on: 1354601
Depends on: 1352189
Depends on: 1352345
Depends on: 1297973
Depends on: 1257456
Depends on: 1333811
Depends on: 1233908
Depends on: 1268276
Depends on: 1243265
Depends on: 1271873
Depends on: 1285423
Depends on: 1354602
Depends on: 1339201
Depends on: 1325057
Depends on: 1218479
Depends on: 1234384
Depends on: 1234390
Depends on: 1308527
Depends on: 1308682
Depends on: 1312253
Depends on: 1315156
Depends on: 1328755
Depends on: 1353442
Depends on: 1281205
Depends on: 1285772
Depends on: 1285901
Depends on: 1292989
Depends on: 1333253
Depends on: 1344519
Depends on: 1339610
Depends on: 1339962
Depends on: 1351893
Depends on: 1316301
Depends on: 1316739
Depends on: 1298064
Depends on: 1359232

Updated

2 years ago
Depends on: 1360614
See Also: → bug 1299577
Depends on: 1364895
Depends on: 1362928
Depends on: 1365019
Depends on: 1367250
Depends on: 1368469
Depends on: 1368815
Depends on: 1368942
Depends on: 1369053
Depends on: 1369761
Depends on: 1365512
Depends on: 1327947
Depends on: 1373822
Depends on: 1375598
No longer depends on: 1365512
Depends on: 1376971
Depends on: 1376973
Depends on: 1386627
Depends on: 1387003
Depends on: 1387430
Depends on: 1387654
Depends on: 1390003
Depends on: 1374788
Depends on: 1391992
Depends on: 1392514
Depends on: 1393822
Depends on: 1397100
Depends on: 1398229
Depends on: 1398394

Updated

2 years ago
Depends on: 1325884

Updated

2 years ago
Depends on: 1240623

Updated

2 years ago
Depends on: 1273058

Updated

2 years ago
Depends on: 1293420

Updated

2 years ago
Depends on: 1309735

Updated

2 years ago
Depends on: 1401408
Depends on: 1401488
Depends on: 1402329
Depends on: 1402608
Depends on: 1403243
Depends on: 1403422
Depends on: 1405542

Updated

2 years ago
Depends on: 1405888
Depends on: 1406031
Depends on: 1406371
Comment hidden (mozreview-request)
Attachment #8915986 - Flags: review?(gijskruitbosch+bugs)
Attachment #8915986 - Flags: review?(amarchesini)
Attachment #8915986 - Attachment is obsolete: true
Depends on: 1407209
Depends on: 1408391
Depends on: 1419589
Depends on: 1419591
Depends on: 1420751
Depends on: 1422056
Depends on: 1422888
Depends on: 1422558
Depends on: 1405780
Depends on: 1425124
Depends on: 1428241
Depends on: 1440329
Depends on: 1442346
Depends on: 1442350

Updated

a year ago
Depends on: 1386673
Depends on: 1450774
Depends on: 1439237

Updated

11 months ago
Depends on: 1454188

Updated

11 months ago
Depends on: 1443673
Depends on: 1456161
Depends on: 1484717
Depends on: 1485582

Updated

7 months ago
Depends on: 1489502
Depends on: 1491984
Depends on: 1502167
Depends on: 1511449

Updated

4 months ago
Depends on: 1512802
Depends on: 1514791
Depends on: 1521443

Updated

2 months ago
Depends on: 1521986

Updated

2 months ago
Depends on: 1524959
Blocks: 1533542
You need to log in before you can comment on or make changes to this bug.