Browser
All browser services are encapsulated through two host objects: Browser and ExternalBrowser.
The Browser object cannot be instantiated directly.
Properties
Type | Property | Description | Standard |
---|---|---|---|
String | name | A browser-implementation specific string describing the browser. The InstantPlayer returns "Avalon" which is the name of the InstantPlayer X3D-Engine. [read only].
| X3D3.0 |
String | version | A browser-implementation specific string describing the browser version. [read only].
| X3D3.0 |
numeric | currentSpeed | If this is not supported, the string "0.0" is returned. [read only].
| X3D3.0 |
numeric | currentFrameRate | If this is not supported, the string "0.0" is returned. [read only].
| X3D3.0 |
String | description | A description of the browser object. [read/write].
| X3D3.0 |
ComponentInfoArray | supportedComponents | The property value cannot be changed, but the properties of the ComponentInfoArray can be [read only].
| X3D3.0 |
ProfileInfoArray | supportedProfiles | The property value cannot be changed, but the properties of the ProfileInfoArray can be [read only].
| X3D3.0 |
Scene | currentScene | The real type of this class is dependent on whether the user code is inside a prototype instance or not. If the user code is inside a prototype instance the property shall represent a ExecutionContext otherwise it shall represent a Scene. [read only].
| X3D3.0 |
Functions
Return type | Function | Description | Standard |
---|---|---|---|
String | getName() | A browser-implementation specific string describing the browser. DeprecatedUse the Browser.name property instead. | X3D2.0 |
String | getVersion() | A browser-implementation specific string describing the browser version (VRML SAI). DeprecatedUse the Browser.version property instead. | X3D2.0 |
numeric | getCurrentSpeed() | If this is not supported, the string "0.0" is returned (VRML SAI). DeprecatedUse the Browser.currentSpeed property instead. | X3D2.0 |
numeric | getCurrentFrameRate() | If this is not supported, the string "0.0" is returned (VRML SAI). DeprecatedUse the Browser.currentFrameRate property instead. | X3D2.0 |
String | getWorldURL() | Returns the URL for the root of the currently loaded world.
DeprecatedUse the Browser.currentScene | X3D2.0 |
void | replaceWorld(Object value) | Replace the current world with this new scene that has been loaded or constructed from somewhere. Note that the signature for this function differs in the X3D2.0 and X3D3.0 specification. Therefore the Object can be a MFNode or an Scene instance.
| X3D2.0, X3D3.0 |
MFNode | createVrmlFromString(String vrml97Syntax) | The string may be any valid VRML content in classic encoding. Returns the content created from the given string.
| X3D2.0 |
void | createVrmlFromURL(MFString url, SFNode node, String event) |
Parse the data in
| X3D2.0 |
void | addRoute(SFNode fromNode, String fromEventOut, SFNode toNode, String toEventIn) |
Add the route
| X3D2.0 |
void | deleteRoute(SFNode fromNode, String fromEventOut, SFNode toNode, String toEventIn) |
Remove the route
| X3D2.0 |
void | loadURL(MFString url, MFString parameter) |
Loads the first recognized URL from the specified
The | X3D2.0 |
void | setDescription(String description) |
Sets the passed string as the current description. This message is displayed in a browser dependent manner. An empty string clears the current description. Scripts that call this method shall have DeprecatedUse the Browser.description read/write property instead. | X3D2.0 |
Scene | createX3DFromString(String x3dSyntax) | Create a scene from the given code. The string may be any valid X3D content in any language supported by the browser implementation. If the browser does not support the content encoding the appropriate exception shall be thrown.
| X3D3.0 |
Scene | createX3DFromURL(MFString url, String callbackName, Object obj) | Create a scene from the given list of urls.
If the | X3D3.0 |
Scene | importDocument(DOMNode domNode) | Create a scene from the given DOMNode. BugNot implemented yet! | X3D3.0 |
String | getRenderingProperty(String name) | Returns the renderingProperty for the given name. All properties are converted to a string internally, even when their normal native type would be an numeric value. BugNot implemented yet! | X3D3.0 |
void | print(Object o) |
Prints the object to the browser's console without a newline character. Successive calls to this function append the descriptions on the same line. The output is the implicit call to the object's
| X3D3.0 |
void | println(Object o) |
Prints the object to the browser's console, inserting a newline character after the output. Successive calls to this function will result in each output presented on separate lines. The output is the implicit call to the object's
| X3D3.0 |
View | getView(String name) | Returns the view with the given name;. name must be the description of a Viewarea or Layer. Returns the first/default view without argument | Avalon |