Global
Values
addEventListener
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. Read more on MDN
Parameters
WebAPI.EventAPI.eventType WebAPI.EventAPI.eventListener option< WebAPI.EventAPI.addEventListenerOptions >Return type
unitaddEventListener_useCapture
Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.
When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.
When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. Read more on MDN
caches
closed
Returns true if the window has been closed, false otherwise. Read more on MDN
createImageBitmap
Parameters
WebAPI.DOMAPI.htmlImageElement option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap10
Parameters
WebAPI.DOMAPI.htmlImageElement int int int int option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap11
Parameters
WebAPI.DOMAPI.svgImageElement int int int int option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap12
Parameters
WebAPI.DOMAPI.htmlVideoElement int int int int option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap13
Parameters
WebAPI.DOMAPI.htmlCanvasElement int int int int option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap14
Parameters
WebAPI.CanvasAPI.imageBitmap int int int int option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap15
Parameters
WebAPI.CanvasAPI.offscreenCanvas int int int int option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap16
Parameters
WebAPI.DOMAPI.videoFrame int int int int option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap17
Parameters
WebAPI.FileAPI.blob int int int int option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap18
Parameters
WebAPI.DOMAPI.imageData int int int int option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap2
Parameters
WebAPI.DOMAPI.svgImageElement option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap3
Parameters
WebAPI.DOMAPI.htmlVideoElement option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap4
Parameters
WebAPI.DOMAPI.htmlCanvasElement option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap5
Parameters
WebAPI.CanvasAPI.imageBitmap option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap6
Parameters
WebAPI.CanvasAPI.offscreenCanvas option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap7
Parameters
WebAPI.DOMAPI.videoFrame option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap8
Parameters
WebAPI.FileAPI.blob option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >createImageBitmap9
Parameters
WebAPI.DOMAPI.imageData option< WebAPI.DOMAPI.imageBitmapOptions >Return type
Promise.t< WebAPI.CanvasAPI.imageBitmap >crossOriginIsolated
crypto
customElements
Defines a new custom element, mapping the given name to the given constructor as an autonomous custom element. Read more on MDN
devicePixelRatio
dispatchEvent
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. Read more on MDN
document
fetch
fetch(string, init)
Starts the process of fetching a resource from the network, returning a promise that is fulfilled once the response is available.
let response = await fetch("https://rescript-lang.org")
Parameters
string option< WebAPI.FetchAPI.requestInit >Return type
Promise.t< WebAPI.FetchAPI.response >fetch_withRequest
fetch_withRequest(request, init)
Starts the process of fetching a resource from the network, returning a promise that is fulfilled once the response is available.
let response = await fetch(myRequest)
Parameters
WebAPI.FetchAPI.request option< WebAPI.FetchAPI.requestInit >Return type
Promise.t< WebAPI.FetchAPI.response >focus
Moves the focus to the window's browsing context, if any. Read more on MDN
Parameters
unitReturn type
unitframeElement
frames
getComputedStyle
history
indexedDB
innerHeight
innerWidth
isSecureContext
length
localStorage
location
locationbar
Returns true if the location bar is visible; otherwise, returns false. Read more on MDN
menubar
Returns true if the menu bar is visible; otherwise, returns false. Read more on MDN
name
navigator
open_
opener
origin
outerHeight
outerWidth
parent
Refers to either the parent WindowProxy, or itself.
It can rarely be null e.g. for contentWindow of an iframe that is already removed from the parent. Read more on MDN
performance
personalbar
Returns true if the personal bar is visible; otherwise, returns false. Read more on MDN
postMessage
Posts a message to the given window. Messages can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.
Objects listed in the transfer member of options are transferred, not just cloned, meaning that they are no longer usable on the sending side.
A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only.
If the origin of the target window doesn't match the given target origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*".
Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned. Read more on MDN
Parameters
JSON.t string option< array< Dict.t< string > > >Return type
unitpostMessage2
Posts a message to the given window. Messages can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.
Objects listed in the transfer member of options are transferred, not just cloned, meaning that they are no longer usable on the sending side.
A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only.
If the origin of the target window doesn't match the given target origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*".
Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned. Read more on MDN
removeEventListener
Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN
Parameters
string WebAPI.EventAPI.eventListener option< WebAPI.EventAPI.eventListenerOptions >Return type
unitremoveEventListener_useCapture
Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN
requestAnimationFrame
requestIdleCallback
Parameters
WebAPI.DOMAPI.idleRequestCallback option< WebAPI.DOMAPI.idleRequestOptions >Return type
intscreen
screenLeft
screenTop
screenX
screenY
scrollbars
Returns true if the scrollbars are visible; otherwise, returns false. Read more on MDN
scrollX
scrollY
self
sessionStorage
speechSynthesis
statusbar
Returns true if the status bar is visible; otherwise, returns false. Read more on MDN
structuredClone
toolbar
Returns true if the toolbar is visible; otherwise, returns false. Read more on MDN