wasm-bindgen icon indicating copy to clipboard operation
wasm-bindgen copied to clipboard

APIs with the [SecureContext] attribute should be an Option<>

Open evilpie opened this issue 1 year ago • 1 comments

Describe the Bug

Any API marked with the [SecureContext] attribute (e.g. the Clipboard API) will be unavailable in non-secure contexts (i.e. HTTP), trying to use the API will result in panics.

Expected Behavior

For example Navigator::clipboard should return Option<Clipboard>

Actual Behavior

For example Navigator::clipboard returns Clipboard

Additional Context

https://webidl.spec.whatwg.org/#SecureContext

evilpie avatar Aug 20 '24 19:08 evilpie

Good point! Will mark this as a breaking change so we can consider it on the next release!

daxpedda avatar Aug 21 '24 14:08 daxpedda