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

feat(core): capabilities on multiwebview contexts #8789

Merged
merged 4 commits into from
Feb 16, 2024

Conversation

lucasfernog
Copy link
Member

Adds a webviews array on the capability model so you can select specific webviews to apply the permissions to.

@lucasfernog lucasfernog marked this pull request as ready for review February 6, 2024 11:14
@lucasfernog lucasfernog requested a review from a team as a code owner February 6, 2024 11:14
@lucasfernog lucasfernog merged commit 0cb0a15 into dev Feb 16, 2024
@lucasfernog lucasfernog deleted the feat/multiwebview-capabilities branch February 16, 2024 11:24
WofWca added a commit to WofWca/tauri that referenced this pull request Mar 16, 2025
It is intuitive to expect that for the capability to be enabled,
_both_ the window label and the webview label have to match.
However, this is not the case: the capability is enabled
if _either_ the window label matches a pattern
in `Capability::windows` _or_ the webview label matches a pattern
in `Capability::webviews`.

This commit should somewhat clarify this oddity
and protect developers from adding excessive permissions.

For reference, `Capability::webviews` was added in
0cb0a15
(tauri-apps#8789).
lucasfernog added a commit that referenced this pull request Mar 17, 2025
* docs: clarify Capability::windows/webviews OR nature

It is intuitive to expect that for the capability to be enabled,
_both_ the window label and the webview label have to match.
However, this is not the case: the capability is enabled
if _either_ the window label matches a pattern
in `Capability::windows` _or_ the webview label matches a pattern
in `Capability::webviews`.

This commit should somewhat clarify this oddity
and protect developers from adding excessive permissions.

For reference, `Capability::webviews` was added in
0cb0a15
(#8789).

* Apply suggestions from code review

Co-authored-by: Amr Bashir <github@amrbashir.me>

* update schemas

---------

Co-authored-by: Amr Bashir <github@amrbashir.me>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
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