Skip to content

[feat] Allow window labels regex or prefix for remote domain access scope #7461

@james138138

Description

@james138138

Describe the problem

Currently, according to the RemoteDomainAccessScope doc and code(

let mut matches_window = s.windows.contains(&label);
), tauri does strict equal check for window labels to enable tauri api.

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;
        }
      }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions