Binds a series of properties and utility methods that are specific to the
deno / web runtimes.
Members
(static, readonly) browserName :string
Gets the name of the browser your page is running.
Type:
- string
- Source:
(static, readonly) eol :string
Gets the newline character specific to the operating system.
Type:
- string
- Source:
(static, readonly) hostname :string
Gets the hostname your page is running
Type:
- string
- Source:
(static, readonly) href :string
Gets the href of where your page is loaded.
Type:
- string
- Source:
(static, readonly) isDeno :boolean
Determines if the runtime is Deno.
Type:
- boolean
- Source:
(static, readonly) isDesktop :boolean
Identifies if you are on desktop or not.
Type:
- boolean
- Source:
(static, readonly) isMobile :boolean
Identifies if you are on mobile or not.
Type:
- boolean
- Source:
(static, readonly) isPWA :boolean
Determines if the running page is an installed Progressive Web App.
Type:
- boolean
- Source:
(static, readonly) isWeb :boolean
Determines if the runtime is Web Browser.
Type:
- boolean
- Source:
(static, readonly) osName :string
Gets the name of the operating system your page is running.
Type:
- string
- Source:
Methods
(static) addEventListener(params) → {void}
Adds an event listener either to the global object or to the specified
event target.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | The named parameters.
Properties
|
- Source:
Returns:
- Type
- void
(static) copyToClipboard(params) → {Promise.<void>}
Copies data to the system clipboard. Only available on the
Web Browser runtime.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
object | The named parameters.
Properties
|
- Source:
Throws:
-
If attempted on the Deno runtime.
- Type
- SyntaxError
Returns:
Of the copy action.
- Type
- Promise.<void>
(static) environment(params) → (nullable) {string}
Parses the environment for the given specified key.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
object | The named parameters.
Properties
|
- Source:
Returns:
The value associated with the key or null if not
found.
- Type
- string
(static) open(params) → {Promise.<(Window|null)>}
Loads a specified resource into a new or existing browsing context
(that is, a tab, a window, or an iframe) under a specified name. These
are based on the different scheme supported protocol items.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | The named parameters.
Properties
|
- Source:
Returns:
The result of the transaction.
- Type
- Promise.<(Window|null)>
(static) print() → {void}
Will open a print dialog when running in a Web Browser.
- Source:
Throws:
-
if you attempt to call this in Deno runtime.
- Type
- SyntaxError
Returns:
- Type
- void
(static) removeEventListener(params) → {void}
Removes an event listener either to the global object or to the
specified event target.
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | The named parameters.
Properties
|
- Source:
Returns:
- Type
- void
(static) share(params) → {Promise.<CShareResult>}
Provides the ability to share items via the share services. You specify
options via the shareData object parameters. Only available on the web
browser runtime.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
params |
object | The named parameters.
Properties
|
- Source:
Returns:
The result of the call.
- Type
- Promise.<CShareResult>
(static) tryDeno() → {Deno}
Determines if we are running in a Deno Runtime or not.
- Source:
Throws:
-
If not running in a Deno Runtime.
- Type
- SyntaxError
Returns:
namespace reference.
- Type
- Deno
(static) tryWeb() → {Window}
Determines if we are running in a Web Browser environment or not.
- Source:
Throws:
-
If not running in a browser environment.
- Type
- SyntaxError
Returns:
Reference to the browser window.
- Type
- Window