Reference / Browser
API iRidi. Browser
Methods and listeners for working with the browser
Methods
IR.OpenBrowser
Open a link in a browser page without leaving i3 pro.
Syntax
IR.OpenBrowser([link](#iropenbrowser));
| Input | Value | Description |
|---|---|---|
| link | "https://google.com" | type: string HTTP(s) link |
| Output | ||
| - |
Example
function OpenBrowser ()
{
IR.OpenBrowser("https://google.com");
}
On iOS, the application is frozen while the browser is in use
Correct operation of the built-in browser is supported only on iOS and Android
IR.CloseBrowser
Close the browser opened inside i3 pro.
Syntax
IR.CloseBrowser();
| Input | Value | Description |
|---|---|---|
| - | ||
| Output | ||
| result | true | type: boolean close the browser window. |
Example
function OpenBrowser ()
{
IR.OpenBrowser("http://google.com");
// открытие браузера </translate>
IR.SetTimeout(9000, function()
{
IR.CloseBrowser();
//закрытие браузера </translate>
})
}
Correct operation of the built-in browser is supported only on iOS and Android
Events
IR.EVENT_BROWSER_PAGE_STARTED
Identifier of the event triggered when a browser page starts loading in i3 Pro.
Syntax
IR.AddListener(IR.EVENT_BROWSER_PAGE_STARTED, 0, [function], [pointer]);
| Input | Value | Description |
|---|---|---|
| function | function() {} | type: function anonymous function or function reference. |
| pointer | - | type: object pointer to the object serving as the function context (optional). |
| Output | ||
| url | https://www.google.com/?gws_rd=ssl | type: string page URL. |
Example
IR.AddListener(IR.EVENT_BROWSER_PAGE_STARTED,0,function(url)
{
IR.Log("STARTED" + url);
})
Correct operation of the built-in browser is supported only on iOS and Android
IR.EVENT_BROWSER_PAGE_FINISHED
Identifier of the event triggered when a browser page finishes loading in i3 Pro.
Syntax
IR.AddListener(IR.EVENT_BROWSER_PAGE_FINISHED, 0, [function](url), [pointer]);
| Input | Value | Description |
|---|---|---|
| function | function() {} | type: function anonymous function or function reference. |
| pointer | - | type: object pointer to the object serving as the function context (optional). |
| Output | ||
| url | https://www.google.com/?gws_rd=ssl | type: string page URL. |
Example
IR.AddListener(IR.EVENT_BROWSER_PAGE_FINISHED,0,function(url)
{
IR.Log("FINISHED" + url);
})
Correct operation of the built-in browser is supported only on iOS and Android
IR.EVENT_BROWSER_PAGE_ERROR
Identifier of the event triggered when a browser page fails to load in i3 Pro.
Syntax
IR.AddListener(IR.EVENT_BROWSER_PAGE_ERROR, 0, function(url, errorCode, errorDescription), [pointer]);
| Input | Value | Description |
|---|---|---|
| function | function() {} | type: function anonymous function or function reference. |
| pointer | - | type: object pointer to the object serving as the function context (optional). |
| Output | ||
| errorCode | 404 | type: number error code. |
| errorDescription | Not Found | type: string error details. |
Example
IR.AddListener(IR.EVENT_BROWSER_PAGE_ERROR,0,function(url, errorCode, errorDescription)
{
IR.Log("ERROR" + errorCode + errorDescription);
})
Correct operation of the built-in browser is supported only on iOS and Android
IR.EVENT_BROWSER_CLOSED
Identifier of the event triggered when the browser closes in i3 Pro.
Syntax
IR.AddListener(IR.EVENT_BROWSER_CLOSED, 0, function, [pointer]);
| Input | Value | Description |
|---|---|---|
| function | function() {} | type: function anonymous function or function reference. |
| pointer | - | type: object pointer to the object serving as the function context (optional). |
| Output | ||
| - |
Example
IR.AddListener(IR.EVENT_BROWSER_CLOSED,0,function()
{
IR.Log("CLOSED");
})
Correct operation of the built-in browser is supported only on iOS and Android