Skip to content

[2.0-rc update 2.0] About the WebviewWindow.getByLabel method in js #11351

Answered by FabianLars
nongyehong asked this question in Q&A
Discussion options

You must be logged in to vote

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

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nongyehong
Comment options

Answer selected by nongyehong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants