Skip to main content

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));

InputValueDescription
link"https://google.com"type: string
HTTP(s) link
Output
-

Example

function OpenBrowser ()
{
IR.OpenBrowser("https://google.com");
}
Note

On iOS, the application is frozen while the browser is in use

Note

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();

InputValueDescription
-
Output
resulttruetype: boolean
close the browser window.

Example

function OpenBrowser ()
{
IR.OpenBrowser("http://google.com");
// открытие браузера </translate>
IR.SetTimeout(9000, function()
{
IR.CloseBrowser();
//закрытие браузера </translate>
})
}
Note

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]);

InputValueDescription
functionfunction() {}type: function
anonymous function or function reference.
pointer-type: object
pointer to the object serving as the function context (optional).
Output
urlhttps://www.google.com/?gws_rd=ssltype: string
page URL.

Example

IR.AddListener(IR.EVENT_BROWSER_PAGE_STARTED,0,function(url)
{
IR.Log("STARTED" + url);
})
Note

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]);

InputValueDescription
functionfunction() {}type: function
anonymous function or function reference.
pointer-type: object
pointer to the object serving as the function context (optional).
Output
urlhttps://www.google.com/?gws_rd=ssltype: string
page URL.

Example

IR.AddListener(IR.EVENT_BROWSER_PAGE_FINISHED,0,function(url)
{
IR.Log("FINISHED" + url);
})
Note

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]);

InputValueDescription
functionfunction() {}type: function
anonymous function or function reference.
pointer-type: object
pointer to the object serving as the function context (optional).
Output
errorCode404type: number
error code.
errorDescriptionNot Foundtype: string
error details.

Example

IR.AddListener(IR.EVENT_BROWSER_PAGE_ERROR,0,function(url, errorCode, errorDescription)
{
IR.Log("ERROR" + errorCode + errorDescription);
})
Note

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]);

InputValueDescription
functionfunction() {}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");
})
Note

Correct operation of the built-in browser is supported only on iOS and Android