Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari presidence for background pages and scripts #38635

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rebloor
Copy link
Contributor

@rebloor rebloor commented Mar 14, 2025

Description

Clarifies that by default when both background pages/scripts and service workers are specified, Safari uses backgrounds pages/script

Related issues and pull requests

Fixes #35630

@rebloor rebloor added the Content:WebExt WebExtensions docs label Mar 14, 2025
@rebloor rebloor requested review from dotproto and Rob--W March 14, 2025 16:44
@rebloor rebloor self-assigned this Mar 14, 2025
@rebloor rebloor requested a review from a team as a code owner March 14, 2025 16:44
@github-actions github-actions bot added the size/xs [PR only] 0-5 LoC changed label Mar 14, 2025
Copy link
Contributor

@rebloor
Copy link
Contributor Author

rebloor commented Mar 14, 2025

FYI @jdatapple

@@ -186,8 +186,7 @@ Support for the `scripts`, `page`, and `service_worker` properties varies betwee
- `background.service_worker` is not supported (see [Firefox bug 1573659](https://bugzil.la/1573659)).
- supports `background.scripts` (or `background.page`) if `service_worker` is not specified or the service worker feature is disabled. Before Firefox 120, Firefox did not start the background page if `service_worker` was present (see [Firefox bug 1860304](https://bugzil.la/1860304)). From Firefox 121, the background page starts as expected, regardless of the presence of `service_worker`.
- Safari:
- supports `background.service_worker`.
- supports `background.scripts` (or `background.page`) if `service_worker` is not specified.
- supports `background.scripts` (or `background.page`) and `background.service_worker`. If both are specified, uses `background.scripts` (or `background.page`), unless `preferred_environment` is set to `service_worker`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Safari (18+) only, if preferred_environment is set to service_worker AND background.service_worker is absent AND background.scripts is present, then these scripts are all executed in a service worker context. @xeenon should that be documented here? (Somewhere?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebExt WebExtensions docs size/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Safari background support for pages and scripts
2 participants