From 6af422ad37f7c1a5e9a2f64d5c68b3b3159d8278 Mon Sep 17 00:00:00 2001 From: Jonas Kruckenberg Date: Thu, 3 Nov 2022 18:52:57 +0100 Subject: [PATCH] add label method --- src/window.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/window.rs b/src/window.rs index 7ca5385..3bec133 100644 --- a/src/window.rs +++ b/src/window.rs @@ -131,6 +131,10 @@ impl WebviewWindow { inner::WebviewWindow::getByLabel(label).map(Self) } + pub fn label(&self) -> String { + self.0.label() + } + pub async fn scale_factor(&self) -> f64 { self.0.scaleFactor().await.as_f64().unwrap() } @@ -632,6 +636,8 @@ mod inner { pub type WindowManager; #[wasm_bindgen(constructor)] pub fn new(label: &str) -> WindowManager; + #[wasm_bindgen(method, getter)] + pub fn label(this: &WindowManager) -> String; #[wasm_bindgen(method)] pub async fn scaleFactor(this: &WindowManager) -> JsValue; #[wasm_bindgen(method)]