Class: Browser

Browser

This is a class which represents a Web browser. The instance of this class can opens and manages multiple windows.


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
url string

An URL string which is mapped to the content.

content object | 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
object Any

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
url strng

A URL string.

Returns:

A new window which promises to load the page content mapped to the url.

Type
Window