-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[feat] Allow window labels regex or prefix for remote domain access scope #7461
Copy link
Copy link
Closed
Labels
Description
Describe the problem
Currently, according to the RemoteDomainAccessScope doc and code(
tauri/core/tauri/src/scope/ipc.rs
Line 139 in 7b45e7f
| let mut matches_window = s.windows.contains(&label); |
We have an application where multiple windows(e.g. feature1-window1, feature1-window2) are opened dynamically, and we want them to be able to call invoke api to commute with the host application.
Describe the solution you'd like
I would like to be able to check window label with regex or prefix instead of strict equal.
Alternatives considered
Create a websocket server to proxy, which seems little overkill for the above use case.
Additional context
This is patch I'm using
let mut matches_window = false;
for window_label_pattern in &s.windows {
if Pattern::new(window_label_pattern).unwrap_or_default().matches(&label) {
matches_window = true;
break;
}
}
Reactions are currently unavailable