Sha256: 47a8d47e0cd745cca697f6d944e145f02695ca422255c3d6e1c9b2b719994b1b
Contents?: true
Size: 824 Bytes
Versions: 30
Compression:
Stored size: 824 Bytes
Contents
# Vendor-prefixed APIs On the web new APIs often have vendor prefixes while they're in an experimental state. For example the `AudioContext` API is known as `webkitAudioContext` in Safari at the time of this writing. The `vendor_prefix` attribute indicates these alternative names, which are used if the normal name isn't defined. For example to use `AudioContext` you might do: ```rust #[wasm_bindgen] extern "C" { #[wasm_bindgen(vendor_prefix = webkit)] type AudioContext; // methods on `AudioContext` ... } ``` Whenever `AudioContext` is used it'll use `AudioContext` if the global namespace defines it or alternatively it'll fall back to `webkitAudioContext`. Note that `vendor_prefix` cannot be used with `module = "..."` or `js_namespace = ...`, so it's basically limited to web-platform APIs today.
Version data entries
30 entries across 30 versions & 1 rubygems