Skip to content

Commit 49dc58e

Browse files
authored
Add userVisibleOnly property to PushSubscriptionOptionsInit (#2288)
Fixes #2287. The PushSubscriptionOptionsInit is currently missing the `userVisibleOnly` property. Signed-off-by: johnsonw <[email protected]>
1 parent 567364e commit 49dc58e

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

crates/web-sys/src/features/gen_PushSubscriptionOptionsInit.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,21 @@ impl PushSubscriptionOptionsInit {
3636
let _ = r;
3737
self
3838
}
39+
#[doc = "Change the `userVisibleOnly` field of this object."]
40+
#[doc = ""]
41+
#[doc = "*This API requires the following crate features to be activated: `PushSubscriptionOptionsInit`*"]
42+
pub fn user_visible_only(&mut self, val: bool) -> &mut Self {
43+
use wasm_bindgen::JsValue;
44+
let r = ::js_sys::Reflect::set(
45+
self.as_ref(),
46+
&JsValue::from("userVisibleOnly"),
47+
&JsValue::from(val),
48+
);
49+
debug_assert!(
50+
r.is_ok(),
51+
"setting properties should never fail on our dictionary objects"
52+
);
53+
let _ = r;
54+
self
55+
}
3956
}

crates/web-sys/webidls/enabled/PushManager.webidl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
dictionary PushSubscriptionOptionsInit {
11-
// boolean userVisibleOnly = false;
11+
boolean userVisibleOnly = false;
1212
(BufferSource or DOMString)? applicationServerKey = null;
1313
};
1414

0 commit comments

Comments
 (0)