At the moment, the main way to retrieve the userContext for a BrowsingContext is to check the usercontextid attribute on the embedderElement. While this is fine for browsingContext.contextCreated and browsingContext.getTree, it won't work for browsingContext.contextDestroyed because the embedder element will no longer be defined on a deleted browsing context. Either we can the information to be stored on the browsing context or we will need to do something similar to what we did for navigable ids in Bug 1694390, ie keep track of a map between navigables and user context ids.
Bug 1874920 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
At the moment, the main way to retrieve the userContext for a BrowsingContext is to check the usercontextid attribute on the embedderElement. While this is fine for browsingContext.contextCreated and browsingContext.getTree, it won't work for browsingContext.contextDestroyed because the embedder element will no longer be defined on a deleted browsing context. Either we can get the information to be stored on the browsing context or we will need to do something similar to what we did for navigable ids in Bug 1694390, ie keep track of a map between navigables and user context ids.