Browser functions
Functions related to the browser
- Source:
browser.utils.ts
closeViewport(requireConfirmation, name)
Simulate closing the viewport by opening a blank page
Parameters
- requireConfirmation - Whether to ask the user for confirmation before closing
- Type:
boolean | undefined
- Default:
false
- Type:
- name - Name of the system
- Type:
string
- Type:
reloadViewport()
Reload the viewport
isValidUrl(string)
Validate a URL string
Parameters
- string - Input string
- Type:
string
- Type:
Returns
- Type:
boolean
setViewportTitle(title)
Change the viewport title by changing meta tags and document title
Parameters
- title - Viewport title
- Type:
string
- Type:
setViewportIcon(url)
Change the viewport icon by changing meta tags
Parameters
- url - URL of the viewport icon
- Type:
string
- Type:
getViewportParams()
Get the current viewport parameters/search queries
Returns
- Type:
Record<string, string>
generateUrl(options)
Generate a system URL based on some options
Parameters
- options
- Type:
GenerateUrlOptions
- Type:
ts
interface GenerateUrlOptions {
appId?: string;
fullscreen?: boolean;
standalone?: boolean;
}
Returns
The generated URL
- Type:
string
openUrl(url, target)
Open a URL in an optional target or the current window
Parameters
- url
- Type:
string
- Type:
- target
- Type:
React.HTMLAttributeAnchorTarget | undefined
- Type:
removeUrlProtocol(url)
Remove the protocol from a URL string
Parameters
- url
- Type:
string
- Type:
Returns
URL without protocol
- Type:
string
copyToClipboard(string, onSuccess, onFail)
Copy text to the user's clipboard
Parameters
- string
- Type:
string
- Type:
- onSuccess
- Type:
Function
- Type:
- onFail
- Type:
Function
- Type: