Skip to content

Add support for tabs.create({ incognito: true }) #897

@carlosjeurissen

Description

@carlosjeurissen

Introduction

This was briefly discussed during the 2024 San Diego meetup.

Some extensions have the use case of opening private tabs. Currently this can only be achieved by using the windows API.

However the windows API is unreliable and unspecified on mobile, see #632

To both make it simpler to open private tabs and make it work on mobile, I suggest we add the incognito property to specify if a new tab should be opened in a private window or a non-private window.

Design

browser.tabs.create({
  incognito: true
});

Tab will be opened in the (last) active private window


browser.tabs.create({
  incognito: false
});

Tab will be opened in the (last) active non-private window


browser.tabs.create({
  incognito: null | undefined
});

Behaviour as if incognito was not set. Tab will be opened in the current window

Discussion

Alternatively we could name the property private to be browser neutral. However it would nolonger align with properties returned by tabs.Tab (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab#incognito). However, in a similar fashion, the private property could be added to tabs.Tab as well. While keeping the incognito as alias.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage: chromeChrome needs to assess this issue for the first timeneeds-triage: firefoxFirefox needs to assess this issue for the first timeproposalProposal for a change or new featuresupportive: safariSupportive from Safari

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions