Closed Bug 1876924 Opened 8 months ago Closed 5 months ago

Treat "incognito":"split" as a warning instead of a hard error

Categories

(WebExtensions :: General, enhancement, P3)

enhancement

Tracking

(firefox127 fixed)

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, Whiteboard: [addons-jira])

Attachments

(1 file)

When an extension has "incognito":"split" in manifest.json, Firefox refuses to load it, because it is not part of the enum at: https://searchfox.org/mozilla-central/rev/4cef3cd672243f7ae6d46103ca0ea7b253a74484/toolkit/components/extensions/schemas/manifest.json#122-127

In Chrome, "incognito":"split" is required if an extension wants to open extension tabs in incognito mode. In Firefox "incognito":"split" is not supported (bug 1380812), and tabs can be opened in private browsing mode (provided that the extension has access to it).

To avoid porting difficulties, we should accept "incognito":"split" value, and log a non-fatal warning instead of preventing the extension from loading.

To resolve this bug, it suffices to turn the enum type in a list of enum where the "split" value is annotated with "deprecated", similar to what was done in https://hg.mozilla.org/mozilla-central/rev/e676737b9689#l2.2 as part of bug 1370077. When we recognize "split" but do not support it, we just treat it as "incognito":"spanning".

Assignee: nobody → rob
Status: NEW → ASSIGNED

(In reply to Rob Wu [:robwu] from comment #0)

To resolve this bug, it suffices to turn the enum type in a list of enum where the "split" value is annotated with "deprecated", similar to what was done in https://hg.mozilla.org/mozilla-central/rev/e676737b9689#l2.2 as part of bug 1370077. When we recognize "split" but do not support it, we just treat it as "incognito":"spanning".

I ultimately ended up using a different implementation, using "onError":"warn". The advantage of this to "deprecated" is that the fallback value ("spanning") is automatically selected instead of using the invalid value. This might also be a good strategy to use to resolve bug 1831417.

See Also: → 1831417

After discussing with the team, there were concerns with silently treating "incognito":"split" as "incognito":"spanning". So the safest option to minimize risk while still supporting extensions, is to accept "incognito":"split" extensions, in non-private browsing mode only. So effectively "incognito": "not_allowed", optionally with a flag/pref to opt in to running the extension in private browsing mode.

Severity: -- → N/A
Priority: -- → P3
Blocks: 1891740
Pushed by rob@robwu.nl: https://hg.mozilla.org/integration/autoland/rev/1b4eeef2a14a Accept manifest with "incognito":"split" r=rpl
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
Type: enhancement → task

Why was this classified as a task? It is an enhancement: previously extensions with incognito:split could not load at all in Firefox, now they can.

Despite this improvement, extension developers are encouraged to drop incognito:split from their manifest because otherwise the extension cannot be used in Firefox's private browsing mode.

Type: task → enhancement
Keywords: dev-doc-needed

If dev-doc is needed for the release, as you just added to the bug, that indeed fits our enhancement definition.

MDN content changes are ready for review:

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: