browser
Provides access to specific browser methods that asynchronously execute in the top frame (cookie, localStorage, sessionStorage)
Anchor to propertiesProperties
- BrowserCookieBrowserCookie
This object replaces the native document.cookie API and provides a setter/getter to set cookies on the top frame.
- Anchor to localStoragelocalStoragelocalStorageBrowserLocalStorageBrowserLocalStorage
- Anchor to sessionStoragesessionStoragesessionStorageBrowserSessionStorageBrowserSessionStorage
- Anchor to sendBeaconsendBeaconsendBeacon(url: string, body?: string) => Promise<boolean>(url: string, body?: string) => Promise<boolean>deprecateddeprecated
- Deprecated
The navigator.sendBeacon() method asynchronously sends an HTTP POST request containing a small amount of data to a web server. Please use the standard web
fetchapi with the optionkeepalive: trueto achieve this functionality.Deprecated:The navigator.sendBeacon() method asynchronously sends an HTTP POST request containing a small amount of data to a web server. Please use the standard web
fetchapi with the optionkeepalive: trueto achieve this functionality.
BrowserCookie
This object replaces the native document.cookie API and provides a setter/getter to set cookies on the top frame.
- get
An asynchronous method to get a specific cookie by name. Takes a cookie name of type `string` and returns the cookie value as a `string`
(name?: string) => Promise<string> - set
An asynchronous method to set a cookie by name. It takes two arguments, a string of form `key=value` as [described here](https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie#write_a_new_cookie) or the name of the cookie as the first argument and the value as the second argument.
(cookieOrName: string, value?: string) => Promise<string>
BrowserLocalStorage
- clear
When invoked, will empty all keys out of the storage.
() => Promise<void> - getItem
When passed a key name, will return that key's value.
(key: string) => Promise<string> - key
When passed a number n, this method will return the name of the nth key in the storage.
(index: number) => Promise<string> - length
Returns an integer representing the number of data items stored in the Storage object.
() => Promise<number> - removeItem
When passed a key name, will remove that key from the storage.
(key: string) => Promise<void> - setItem
When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.
(key: string, value: any) => Promise<void>
BrowserSessionStorage
- clear
When invoked, will empty all keys out of the storage.
() => Promise<void> - getItem
When passed a key name, will return that key's value.
(key: string) => Promise<string> - key
When passed a number n, this method will return the name of the nth key in the storage.
(index: number) => Promise<string> - length
Returns an integer representing the number of data items stored in the Storage object.
() => Promise<number> - removeItem
When passed a key name, will remove that key from the storage.
(key: string) => Promise<void> - setItem
When passed a key name and value, will add that key to the storage, or update that key's value if it already exists.
(key: string, value: any) => Promise<void>