From 0630d733da8f47c08d9541472e9d43c8228288ed Mon Sep 17 00:00:00 2001 From: johnsonw Date: Tue, 18 Aug 2020 17:49:56 -0400 Subject: [PATCH] Add userVisibleOnly property to PushSubscriptionOptionsInit Fixes #2287. The PushSubscriptionOptionsInit is currently missing the `userVisibleOnly` property. Signed-off-by: johnsonw --- .../features/gen_PushSubscriptionOptionsInit.rs | 17 +++++++++++++++++ .../web-sys/webidls/enabled/PushManager.webidl | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs b/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs index 95501caddf2..c42afe62db7 100644 --- a/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs +++ b/crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs @@ -36,4 +36,21 @@ impl PushSubscriptionOptionsInit { let _ = r; self } + #[doc = "Change the `userVisibleOnly` field of this object."] + #[doc = ""] + #[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"] + pub fn user_visible_only(&mut self, val: bool) -> &mut Self { + use wasm_bindgen::JsValue; + let r = ::js_sys::Reflect::set( + self.as_ref(), + &JsValue::from("userVisibleOnly"), + &JsValue::from(val), + ); + debug_assert!( + r.is_ok(), + "setting properties should never fail on our dictionary objects" + ); + let _ = r; + self + } } diff --git a/crates/web-sys/webidls/enabled/PushManager.webidl b/crates/web-sys/webidls/enabled/PushManager.webidl index 7c8c6628409..2579597afd2 100644 --- a/crates/web-sys/webidls/enabled/PushManager.webidl +++ b/crates/web-sys/webidls/enabled/PushManager.webidl @@ -8,7 +8,7 @@ */ dictionary PushSubscriptionOptionsInit { - // boolean userVisibleOnly = false; + boolean userVisibleOnly = false; (BufferSource or DOMString)? applicationServerKey = null; };