Methods
(async, static) create(options) → {Promise.<View>}
Creates a new View.
Parameters:
Name | Type | Description |
---|---|---|
options |
View~options | View creation options |
- Tutorials:
Returns:
- Type
- Promise.<View>
(static) getCurrent() → {Promise.<View>}
Asynchronously returns a View object that represents the current view
- Tutorials:
Returns:
- Type
- Promise.<View>
(static) getCurrentSync() → {View}
Synchronously returns a View object that represents the current view
- Tutorials:
Returns:
- Type
- View
(async, static) wrap(identity) → {Promise.<View>}
Asynchronously returns a View object that represents an existing view.
Parameters:
Name | Type | Description |
---|---|---|
identity |
Identity |
- Tutorials:
Returns:
- Type
- Promise.<View>
(static) wrapSync(identity) → {View}
Synchronously returns a View object that represents an existing view.
Parameters:
Name | Type | Description |
---|---|---|
identity |
Identity |
- Tutorials:
Returns:
- Type
- View
attach(target) → {Promise.<void>}
Attaches the current view to a the given window identity. Identity must be the identity of a window in the same application. This detaches the view from it's current window, and sets the view to be destroyed when its new window closes.
Parameters:
Name | Type | Description |
---|---|---|
target |
Identity |
- Tutorials:
Returns:
- Type
- Promise.<void>
destroy() → {Promise.<void>}
Destroys the current view
- Tutorials:
Returns:
- Type
- Promise.<void>
getCurrentWindow() → {Promise.<_Window>}
Retrieves the window the view is currently attached to.
- Tutorials:
Returns:
- Type
- Promise.<_Window>
getInfo() → {Promise.<ViewInfo>}
Gets the View's info.
- Tutorials:
Returns:
- Type
- Promise.<ViewInfo>
getOptions() → {Promise.<ViewCreationOptions>}
Gets the View's options.
- Tutorials:
Returns:
- Type
- Promise.<ViewCreationOptions>
hide() → {Promise.<void>}
Hides the current view if it is currently visible.
- Tutorials:
Returns:
- Type
- Promise.<void>
navigate(url) → {Promise.<void>}
Navigates the view to a specified URL. The url must contain the protocol prefix such as http:// or https://.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL to navigate the view to. |
- Tutorials:
Returns:
- Type
- Promise.<void>
setBounds(bounds) → {Promise.<void>}
Sets the bounds (top, left, width, height) of the view relative to its window.
Parameters:
Name | Type | Description |
---|---|---|
bounds |
Bounds |
- Tutorials:
Returns:
- Type
- Promise.<void>
setCustomWindowHandler(urls) → {function}
Sets a custom window handler.
Parameters:
Name | Type | Description |
---|---|---|
urls |
string | Array.<string> |
Returns:
- Type
- function
show() → {Promise.<void>}
Shows the current view if it is currently hidden.
- Tutorials:
Returns:
- Type
- Promise.<void>
updateOptions(options) → {Promise.<void>}
Gets the view's info.
Parameters:
Name | Type | Description |
---|---|---|
options |
Partial.<ViewOptions> |
- Tutorials:
Returns:
- Type
- Promise.<void>
Type Definitions
options
View creation options.
This is the options object required by View.create.
Note that name
and target
are the only required properties — albeit the url
property is usually provided as well
(defaults to "about:blank"
when omitted).
Type:
- object
Properties:
Name | Type | Attributes | Default | Description | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
api |
object |
<optional> |
Configurations for API injection. Properties
|
||||||||||||||||||||||||
autoResize |
object |
<optional> |
AutoResize options |
||||||||||||||||||||||||
bounds |
object |
<optional> |
initial bounds |
||||||||||||||||||||||||
backgroundColor |
string |
<optional> |
"#FFF" | Updatable.
The view’s backfill color as a hexadecimal value. Not to be confused with the content background color
( |
|||||||||||||||||||||||
contentNavigation |
object |
<optional> |
Restrict navigation to URLs that match a whitelisted pattern. In the lack of a whitelist, navigation to URLs that match a blacklisted pattern would be prohibited. See here for more details. Properties
|
||||||||||||||||||||||||
contextMenuSettings |
object |
<optional> |
Updatable. Configure the context menu when right-clicking on a view. Properties
|
||||||||||||||||||||||||
customData |
any |
<optional> |
"" | Updatable.
A field that the user can attach serializable data to to be ferried around with the view options.
When omitted, the default value of this property is the empty string ( |
|||||||||||||||||||||||
customContext |
any |
<optional> |
"" | Updatable.
A field that the user can use to attach serializable data that will be saved when Platform.getSnapshot
is called. If a window or a view in a Platform is trying to update or retrieve its own context, it can use the
Platform.setContext and Platform.getContext calls.
When omitted, the default value of this property is the empty string ( |
|||||||||||||||||||||||
name |
string | The name of the view. |
|||||||||||||||||||||||||
preloadScripts |
Array.<preloadScript> |
<optional> |
Inheritable A list of scripts that are eval'ed before other scripts in the page. When omitted, inherits from the parent application. |
||||||||||||||||||||||||
processAffinity |
string |
<optional> |
<application uuid> | A string to attempt to group renderers together. Will only be used if pages are on the same origin. |
|||||||||||||||||||||||
target |
Identity |
<optional> |
The identity of the window this view should be attached to. |
||||||||||||||||||||||||
url |
string |
<optional> |
"about:blank" | The URL of the view. |
|||||||||||||||||||||||
uuid |
string |
<optional> |
<application uuid> | The |