Эта страница является
переводом страницы
Browser API. Перевод выполнен на 100%.
API iRidium.Browser
methods and listeners to work with browser
Methods
IR.OpenBrowser
Open the link on a browser page, without leaving i3 pro.
Syntax
IR.OpenBrowser(link);
| link
|
"https://google.com"
|
type: string HTTP(s) link
|
-
Sample
function OpenBrowser ()
{
IR.OpenBrowser("https://google.com");
}
During work with a browser apps on iOS "freeze".
Correct work with a built-in browser is supported only on iOS and Android.
IR.CloseBrowser
Close the browser opened in the i3 pro app
Syntax
IR.CloseBrowser();
-
| result
|
true
|
type: boolean Closing browser window
|
Sample
function OpenBrowser ()
{
IR.OpenBrowser("http://google.com"); // opening browser
IR.SetTimeout(9000, function()
{
IR.CloseBrowser(); //closing browser
})
}
Correct work with a built-in browser is supported only on iOS and Android.
Events
IR.EVENT_BROWSER_PAGE_STARTED
ID of the event that is activated when a browser page starts loading in the i3 pro app.
Syntax
IR.AddListener(IR.EVENT_BROWSER_PAGE_STARTED, 0, function(url), [pointer]);
| function
|
function() {}
|
type: function an unnamed function or a function call
|
| pointer
|
-
|
type: object a pointer to an object that services a function (optional)
|
| url
|
https://www.google.com/?gws_rd=ssl
|
type: string url address of the page.
|
Sample
IR.AddListener(IR.EVENT_BROWSER_PAGE_STARTED,0,function(url)
{
IR.Log("STARTED" + url);
})
Correct work with a built-in browser is supported only on iOS and Android.
IR.EVENT_BROWSER_PAGE_FINISHED
ID of the event that is activated when a browser page end loading in the i3 pro app.
Syntax
IR.AddListener(IR.EVENT_BROWSER_PAGE_FINISHED, 0, function(url), [pointer]);
| function
|
function() {}
|
type: function an unnamed function or a function call
|
| pointer
|
-
|
type: object a pointer to an object that services a function (optional)
|
| url
|
https://www.google.com/?gws_rd=ssl
|
type: string url address of the page.
|
Sample
IR.AddListener(IR.EVENT_BROWSER_PAGE_FINISHED,0,function(url)
{
IR.Log("FINISHED" + url);
})
Correct work with a built-in browser is supported only on iOS and Android.
IR.EVENT_BROWSER_PAGE_ERROR
ID of the event that is activated when there is an error in loading a browser page in the i3 pro app.
Syntax
IR.AddListener(IR.EVENT_BROWSER_PAGE_ERROR, 0, function(url, errorCode, errorDescription), [pointer]);
| function
|
function() {}
|
type: function an unnamed function or a function call
|
| pointer
|
-
|
type: object a pointer to an object that services a function (optional)
|
| errorCode
|
404
|
type: number the error code
|
| errorDescription
|
Not Found
|
type: string details of the error
|
Sample
IR.AddListener(IR.EVENT_BROWSER_PAGE_ERROR,0,function(url, errorCode, errorDescription)
{
IR.Log("ERROR" + errorCode + errorDescription);
})
Correct work with a built-in browser is supported only on iOS and Android.
IR.EVENT_BROWSER_CLOSED
ID of the event that is activated when a browser is closed in the i3 pro app.
Syntax
IR.AddListener(IR.EVENT_BROWSER_CLOSED, 0, function, [pointer]);
| function
|
function() {}
|
type: function an unnamed function or a function call
|
| pointer
|
-
|
type: object a pointer to an object that services a function (optional)
|
-
Sample
IR.AddListener(IR.EVENT_BROWSER_CLOSED,0,function()
{
IR.Log("CLOSED");
})
Correct work with a built-in browser is supported only on iOS and Android.