mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-24 10:11:34 +00:00
Add a top-level web_sys::window
function
Returns `Option<Window>` and can be used as a convenience to get a handle to the global `window` object.
This commit is contained in:
@ -9,7 +9,7 @@ use wasm_bindgen::JsCast;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn main() {
|
||||
let document = web_sys::Window::document().unwrap();
|
||||
let document = web_sys::window().unwrap().document().unwrap();
|
||||
let canvas = document
|
||||
.create_element("canvas")
|
||||
.unwrap()
|
||||
|
Reference in New Issue
Block a user