[2.0-rc update 2.0] About the WebviewWindow.getByLabel method in js #11351
Answered
by
FabianLars
nongyehong
asked this question in
Q&A
-
|
Beta Was this translation helpful? Give feedback.
Answered by
FabianLars
Oct 14, 2024
Replies: 1 comment 1 reply
-
Because tauri's IPC forces the use of async and the function needs to communicate with the rust backend to reliably get the currently available windows (ref). If this is a problem but you're sure the window exists, you can do this new WebviewWindow("your-label", { skip: true })
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nongyehong
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because tauri's IPC forces the use of async and the function needs to communicate with the rust backend to reliably get the currently available windows (ref). If this is a problem but you're sure the window exists, you can do this
skip: true
is not part of the public api so typescript will complain but this way it won't try to create a new webview. We used to have a getByLabelUnchecked i think, no idea where it went.