Firefox containers are something that you need to truly understand. You might have heard of them and wondered what they are. They actually help us in ways that you might not even realize. To gain a better understanding of them, you must first understand how web tracking works. They are a feature in the Firefox web browser that allows users to create and manage multiple browsing contexts or “containers” within a single browser window. Each container has its own separate browsing session, cookies, history, and other data, and it can be used to isolate and protect different activities or identities online.

Facebook Containers

To help you better understand Firefox Containers, we will take a close look at Facebook. For instance, Joshua might look up used laptops on a search engine and visit the first websites that appear in the results. Later, he might carry on with his day. Once he opens Facebook later, he will begin to see recommendations for used laptops. At first, Joshua would feel puzzled as he had never even searched for used laptops on social media.

The question is how this did even happen. The fact is that the pages Joshua visited might have elements related to Facebook like a Share button or a Like button. The website might also be using Facebook Pixel which is code from the social media site. It is used for tracking visitor activity.

The website Joshua had visited might use third-party tracking cookies or have ads. The cookies might be used for linking activities to your computer. They would remain active unless you delete them or they expire. They are simply a part of your digital fingerprint which contains your personally identifiable details like operating system, location, browser information, or IP address.

The data is shared with the websites you visit and social media. Therefore, when Joshua signs into Facebook, those cookies would instantly identify him as having visited the website of the used laptop. It helps the website track you and displays relevant pages. Things only get worse with third-party cookies and ads. The data might get shared with companies that are affiliated with the advertising network. The truth is that Facebook uses various tracking methods and only one of those methods has been mentioned. It is the reason why Mozilla Firefox comes with a Facebook Container add-on which is an extension that prevents tracking.

Cookies are not as bad as you think. The ones you use for signing into accounts are rather helpful. You would need to store these to ensure that you do not have to sign in every time. However, there are some cookies that do more than that. They track your internet usage even when you have left the website. This is why you need Firefox Containers. Cookie-based tracking is a technique used by websites and online services to track and record the online activities of users. This technique involves the use of cookies, which are small pieces of data that are stored on the user’s computer by the web browser.

Cookies can be used for many different purposes, including storing user preferences, login information, and shopping cart contents. However, cookies can also be used for tracking and recording the user’s online activities, such as the websites they visit, the searches they perform, and the advertisements they click on.

Cookie-based tracking is typically performed by website operators or third-party advertising networks. When a user visits a website, the website or the advertising network can set a cookie on the user’s computer. This cookie can then be used to track the user’s online activities and to record the websites they visit, the searches they perform, and the advertisements they click on.

Cookie-based tracking can be used for various purposes, such as personalized advertising, market research, and user behavior analysis. However, it can also raise concerns about privacy and user control, as it allows websites and advertisers to collect and use data about the user’s online activities without their knowledge or consent.

Firefox Containers

The best way to prevent cookie-based tracking is by isolating those cookies using Firefox Containers. Storing them in different jars allows you to keep things in check. You also have the option to block third-party cookies on the browser which would handle most of the cookie-based tracking. You can set a container for Google, Twitter, Amazon, PayPal, and so on. You can rely on Firefox Containers for the best online experience. They will make your life a whole lot easier by preventing third-party cookies from following you.

What are the default Firefox Containers

When you first install Firefox, the browser comes with several default containers that are pre-configured and ready to use. The default containers in Firefox include:

  • Personal: This is the default container that is used for your everyday browsing activities. It has access to all of your cookies and history, and it is the container that is used when you open a new tab or window.
  • Work: This container is intended for use with work-related sites and accounts. It has access to a separate set of cookies and history, and it can be used to keep your work and personal activities separate.
  • Shopping: This container is intended for use with online shopping and e-commerce sites. It has access to a separate set of cookies and history, and it can be used to protect your personal and payment information from being tracked or shared by shopping sites.
  • Banking: This container is intended for use with online banking and financial sites. It has access to a separate set of cookies and history, and it can be used to protect your sensitive financial information and prevent phishing and other attacks.
  • Social: This container is intended for use with social media and networking sites. It has access to a separate set of cookies and history

How can I Create a Custom Firefox Container

To create a custom Firefox container, you can follow these steps:

  • Open the Firefox web browser and click on the “Menu” button (the three horizontal lines) in the top-right corner of the window.
  • From the menu, select “Options” and then click on the “Privacy & Security” tab on the left side of the window.
  • Scroll down to the “Containers” section and click on the “Manage Containers” button. This will open the Containers settings page.
  • On the Containers settings page, click on the “Add Container” button to create a new container.
  • In the “Add Container” dialog box, enter a name for the new container and choose a color for the container tab. You can also choose whether to enable or disable the “Always use this container” option, which determines whether the container will be used automatically for all sites that match the container’s rules.
  • Click on the “Create” button to create the new container. The container will now appear in the list of containers on the Containers settings page.
  • To add sites to the new container, click on the container’s name in the list, and then click on the “Add Site” button. In the “Add Site” dialog box, enter the URL of the site that you want to add to the container, and then click on the “Add” button.
  • Repeat this process to add additional sites to the container, as needed. You can also edit or delete the container or its rules by using the corresponding buttons on the Containers settings page.

Creating a custom Firefox container is a simple process that allows you to create and manage multiple browsing contexts within a single browser window. This can be useful for isolating and protecting different activities or identities online, and it can help you to better control your privacy and security on the web.

Firefox Container For Extension Developers

To create a Firefox container using JavaScript code, you can use the create() method of the browser.contextualIdentities object. This method allows you to create a new container with a specified name, color, and icon, and it returns a contextualIdentity object that represents the new container.

Here is an example of JavaScript code that creates a Firefox container:

// Define the name, color, and icon of the new container
const name = "My Container";
const color = "blue";
const icon = "briefcase";

// Create the new container using the `create()` method
const container = await browser.contextualIdentities.create({
  name,
  color,
  icon
});

// Log the details of the new container to the console
console.log(container.name);
console.log(container.color);
console.log(container.icon);

In this example, the create() method is called with an object that specifies the name, color, and icon of the new container. The method returns a contextualIdentity object that represents the new container, and the details of the container are logged to the console.

You can use this code as a starting point to create a Firefox container using JavaScript, and you can modify the code to customize the name, color, and icon of the container, as needed.

To open a tab in a Firefox container, you can use the create() method of the browser.tabs object. This method allows you to create a new tab in the specified container, and it returns a tab object that represents the new tab.

Here is an example of JavaScript code that opens a tab in a Firefox container:

// Define the URL of the page to open and the ID of the container
const url = "https://www.example.com";
const containerId = "my-container";

// Create a new tab in the specified container using the `create()` method
const tab = await browser.tabs.create({ url, cookieStoreId: containerId });

// Log the details of the new tab to the console
console.log(tab.id);
console.log(tab.url);
console.log(tab.cookieStoreId);

In this example, the create() method is called with an object that specifies the URL of the page to open and the ID of the container where the tab should be opened. The method returns a tab object that represents the new tab, and the details of the tab are logged to the console.