Skip to content

Conversation

@monica-ch
Copy link

No description provided.

@monica-ch monica-ch mentioned this pull request Nov 3, 2025

**Dedicated Workers:**
- For network scripts: Parse `Document-Policy` from the worker script's HTTP response headers
- If no `Document-Policy` header is present: Feature is disabled by default (e.g., self-js-profiling not exposed)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should likely converge to existing behavior for document context which is for each configuration point to have a default value of its own. It might not seem that different for self-js-profiling, but Document Policy does define more than booleans.

**Shared Workers:**
- For network scripts: The worker script response headers define the effective Document Policy
- When multiple documents attach to the same worker:
- The first document that creates the worker establishes its effective document policy from the script's HTTP response header
Copy link
Contributor

Choose a reason for hiding this comment

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

Might benefit from some re-wording? AFAIU the document doesn't really play a role other than initiating the request? So it would be the Document Policy is set from the script's HTTP response header when the worker is first created?

- For network scripts: The worker script response headers define the effective Document Policy
- When multiple documents attach to the same worker:
- The first document that creates the worker establishes its effective document policy from the script's HTTP response header
- Later attachers with mismatched policies are ignored.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do I understand correctly that it's not only documents attaching later, but Document Policy from worker clients is not considered at all for what the policy in the worker is? For example:

document 1: ``
worker script: self-js-profiling

So the feature is enabled on in the worker context regardless of the policy in the creating document?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants