Firefox Sync and temporary containers fix

My synchronized Firefox items got out of sync. Here is how I fixed that.

  1. Log out of Firefox Sync on every machine that has Firefox.
  2. Backup your profile on your master machine.
  3. On every machine except the machine I want to keep as master, delete all temporary containers.
    1. This is most easily done with [copy]about:preferences#containers[/copy]
    2. Click on the remove button for all the temporary containers that start with tmp.
  4. Go to [copy]about:support[/copy] in Firefox on the master machine.
    1. Click the Open Directory button to open the profile directory folder.
  5. Copy the containers.json file to an external file share of some sort. It could be a USB key, or Nextcloud, or email it to yourself and use webmail to get a copy of it.
  6. Go to [copy]about:support[/copy] in Firefox on the slave machine.
    1. Click the Open Directory button to open the profile directory folder.
    2. Exit Firefox.
  7. Copy the containers.json file from the external share to the opened profile folder. Yes – replace the file.
  8. Start Firefox on the slave machine, and log in to the containers you have set which need to keep their login state.

  1. Log in to Firefox Sync on the master machine. You can do this, though it will only really help with keeping bookmarks in sync.
    1. Note that it sent me a confirmation code to my email address.
  2. Log in to Firefox Sync on all the rest of the machines.
  1. Note that if in Step 2, you have too many containers to click the remove button on:Navigate to about:debugging#/runtime/this-firefox
    1. Scroll down to Temporary Containers and click “Inspect” to the right of it.
    2. Click “Console”
    3. Insert into the console

const containers = await browser.contextualIdentities.query({});
await Promise.all(containers.map(container => {
if (tmp.container.isTemporary(container.cookieStoreId)) return;
const prefix = 'tmp';
if (container.name.substring(0, prefix.length) !== prefix) {return;}
return browser.contextualIdentities.remove(container.cookieStoreId);
}));
console.log("done");

Credit where credit is due: https://github.com/stoically/temporary-containers/issues/371

SO, I’m trying to use a WordPress plugin that lets one copy the code above to the clipboard. However, what then got pasted into the Firefox console was “helpfully” upgraded to UTF fancy quotes instead of the simple ASCII ‘ and ” characters. Please stop helping … or at least give me a way to override.

And of course … it does not work.

I have a set of temporary containers on my master machine, but, my other machines will not copy that list.

At least the slave instances don’t wipe out the master list.

I’ve updated this post with instructions that do copy the containers list to the slave machines. I don’t expect that Firefox Sync will be able to keep them in sync, though.

Leave a Reply