Skip to content

Developer Documentation

Danny Colin edited this page Dec 29, 2023 · 2 revisions

Debugging containers

Access Extension Storage from about:debugging

  1. Type about:debugging in the address bar
  2. Click on "This Firefox" button in the sidebar
  3. Search Multi-Account Containers in the list and click on the "inspect" button
  4. In the newly opened devtool window, go to "Storage" tab
  5. Expand the "Extension Storage" item in the sidebar

Key starting with siteContainerMap@@_ are website assignments mapping.

Access Extension Storage from your user profile folder [Outdated]

  1. Go to about:profiles
  2. Open the root directory of the current profile
  3. The following files are used by the extension:
    1. [root-directory]/containers.json - used by the browser to store the containers available, their names, icons and colors.
    2. [root-directory]/browser-extension-data/@testpilot-containers/storage - used by the web extension to store assigned containers, also what versions the user opened the container on to show "new" content.
    3. The following may also exist: [root-directory]/jetpack/@testpilot-containers/simple-storage - this is the legacy storage of the extension and used to remember what preferences the user had to clean up when the user uninstalls the extension. This in 57 is no longer needed and removing container addons will remove all containers when there are none left.

API

Multi-Account Containers provides the possibility for other WebExtension to ask for assignments by using the runtime.sendMessage API.

The contextualIdentities permission is required to send messages.

The message that is sent must be an object with the following properties:

  • method set to getAssignment
  • url with the URL to check for assignment

The reply is a Promise that resolves to either null if no assignment was found or to an object with at least the following properties:

  • neverAsk, boolean, true if the assignment was made permanent with "Remember my choice"
  • userContextId, string, the cookieStoreId without the leading firefox-container-

If the contextualIdentities permission is missing, no method is given, the method is unknown or the url parameter is undefined for the getAssignment method the Promise will get rejected.

Example usage:

browser.runtime.sendMessage('@testpilot-containers', {
  method: 'getAssignment',
  url: 'https://example.com'
}).then((assignment) => {
  // Use result
}).catch((error) => {
  // Something went wrong
});