new Browser(initConfig)
Creates a new instance of this class.
Parameters:
| Name | Type | Description |
|---|---|---|
initConfig |
object | Browser | An object to initialize an instance of this class. |
Methods
-
addContent(url, content)
-
Add a HTML/XML content with its URL.
Parameters:
Name Type Description urlstring An URL string which is mapped to the content.
contentobject | string A page content. This is an object which contains a content HTML/XML string and its properties, or a HTML/XML string.
Returns:
- Type
- Void
-
getConfig(object)
-
Gets the config object which is associated with the specified object.
Parameters:
Name Type Description objectAny An configured object like a Window object or a Screen object.
Returns:
A config object like a WindowConfig object or a ScreenConfig object.
- Type
- object
-
newWindow()
-
Creats a new blank window.
Returns:
A new winow which has a blank page.
- Type
- Window
-
openWindow(url)
-
Creatss a new window and loads the page content mapped to the specified URL with
Browser#addContent.Loading content is processed asynchronously. The event of completion of loading is able to caught by WindowConfig#on or WindowConfig#once.
Parameters:
Name Type Description urlstrng A URL string.
Returns:
A new window which promises to load the page content mapped to the url.
- Type
- Window