Skip to content

Conversation

@chetanpandey1266
Copy link
Contributor

Draft API review for Trusted Origin APIs

@chetanpandey1266 chetanpandey1266 changed the title [API Review] Trusted Origin APIs API Review: Trusted Origin APIs Nov 12, 2025
@chetanpandey1266 chetanpandey1266 force-pushed the user/chetanpandey/TrustedOriginSpecNew-draft branch from 220f538 to d9fb9b3 Compare November 12, 2025 13:35

- AccentColor
- EnhancedSecurityMode
- PersistenceStorage
Copy link
Contributor

Choose a reason for hiding this comment

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

Grammar: You probably want "PersistentStorage" or "StoragePersistence"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will make the change. Will prefer PersistentStorage.

/// | `*example/` | `https://app.example/`,`https://api.example/` | Matches any subdomain and top-level domain variations |
/// | `https://xn--qei.example/` | `https://❤.example/`,`https://xn--qei.example/` | Normalized punycode matches with corresponding Non-ASCII hostnames |
///
/// Note: `*` is not a valid value for OriginPattern.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not? This seems like it should be valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This means we are enabling/disabling for all the origins, which might not be true for all the features we are supporting. For example, persistence storage can't be enabled for all the origins. Because for all origins if we make storage persistent, in case of low disk space there would be no eviction and it might lead to issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And if there is a need for toggle control, we'll add APIs as required.

Copy link
Contributor

Choose a reason for hiding this comment

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

in case of low disk space there would be no eviction and it might lead to issues.

I'm pretty sure in most cases we allow developers to shoot themselves in the foot.

Copy link
Contributor

Choose a reason for hiding this comment

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

And if there is a need for toggle control, we'll add APIs as required.

Is that the right path though? Maybe more of a question for @shrinaths / @david-risney but if we had this API (with just * allowed) when we were implementing something like CoreWebView2Profile.PreferredTrackingPreventionLevel, would we have implemented it? It seems like it could be cleaner and easier to have this API as the primary way to support enabling/disabling features for all origins in a profile for future additions.

Copy link
Contributor Author

@chetanpandey1266 chetanpandey1266 Nov 19, 2025

Choose a reason for hiding this comment

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

I think today also we can make all the storage persistent. Using --unlimited-storage we can do that.
ref: #72
So thinking of removing this.

- AccentColor
- EnhancedSecurityMode
- PersistenceStorage
- TrackingPrevention
Copy link
Contributor

Choose a reason for hiding this comment

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

You should explain how this interacts with CoreWebView2EnvironmentOptions.EnableTrackingPrevention and CoreWebView2Profile.PreferredTrackingPreventionLevel.

Same for ESM and the other API we're working on for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah sure will add it for tracking prevention and ESM
For Accent Color and Persistent Storage I have already mentioned the default state.

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.

3 participants