Closed Bug 1738567 Opened 7 months ago Closed 4 months ago

Support cookieStoreId option in userScripts.register

Categories

(WebExtensions :: General, enhancement, P5)

Firefox 97
enhancement

Tracking

(firefox98 fixed)

RESOLVED FIXED
98 Branch
Tracking Status
firefox98 --- fixed

People

(Reporter: eros_uk, Assigned: onlinericha19)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

Target APIs:

  • contentScripts.register()
  • userScripts.register()

Currently, users are able to decide whether an extension can run in Private Browsing Mode or not, and set it globally.

Scripts (or CSS) in contentScripts.register() & userScripts.register() are registered from the background script globally and do not differentiate between normal or private browsing.

Being able to set whether the script (or CSS) should be injected in private mode or not, would enhance (the control over) the aforementioned APIs.

For example, the following registration would only inject into tabs in normal mode.

const scriptObj = await browser.contentScripts.register({
  matches: ["*://*.org/*"],
  js: [{file: "/content_scripts/example.js"}],
  runAt: "document_idle",
  incognito: false                // defaults to true
});

Update

Change to Support cookieStoreId option in userScripts.register

const scriptObj = await browser.contentScripts.register({
  matches: ["*://*.org/*"],
  js: [{file: "/content_scripts/example.js"}],
  runAt: "document_idle",
  cookieStoreId: "firefox-default"
});
Flags: needinfo?(lgreco)

Support for cookieStoreId: "firefox-private" is being introduced in bug 1470651.

That's only for contentScripts.register, not userScripts.register though.

Severity: -- → S4
Depends on: 1470651
Flags: needinfo?(lgreco)
Priority: -- → P5
Assignee: nobody → onlinericha19
Status: NEW → ASSIGNED

Will the cookieStoreId in userScripts.register feature be ready for Firefox 97 like contentScripts.register?

Flags: needinfo?(onlinericha19)

Maybe, if the review+update cycle completes in time.

Flags: needinfo?(onlinericha19)
Summary: Add Incognito flag to script injection APIs → Support cookieStoreId option in userScripts.register
Version: Firefox 95 → Firefox 97

Can the unit tests be made available for the review for the current Firefox 97 (as requested on Dec 15th)?
Note: Firefox 97 soft freeze date is 2022-01-06.

Flags: needinfo?(onlinericha19)

The patch author is a volunteer who is not bound to deadlines.

Flags: needinfo?(onlinericha19)

I'll try to have a unit test ready before the soft freeze.

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:onlinericha19, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(rob)
Flags: needinfo?(onlinericha19)
Flags: needinfo?(rob)
Flags: needinfo?(onlinericha19)
Keywords: dev-doc-needed
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/82b887dab708
Support cookieStoreId option in userScripts.register r=robwu
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

Documentation changes are ready for review:

Flags: needinfo?(rob)
Flags: needinfo?(rob)
You need to log in before you can comment on or make changes to this bug.