ssCore.Browser.getURL

Retrieve the current URL.


Availability:

First available in version 3.0 build 2039.


Input Parameters:

None.


Output Parameters:

result - The URL of the current page.


Asynchronous Mode:

When this method is called asynchronously, a return object containing the output parameters is passed to the specified callback function.

ssCore.Browser.getURL( paramsObject [, callbackParamsObject] [, errorParamsObject] );


Synchronous Mode:

When this method is called synchronously, a return object containing the output parameters is returned to the caller immediately.

var returnObject = ssCore.Browser.getURL( paramsObject );


Notes:

None.


Examples:

ssCore.init();
ssDefaults.synchronousCommands = true;

ssCore.Browser.setPosition ({x:0, y:50});
ssCore.Browser.setSize ({width:Stage.width, height:Stage.height-50});

ssCore.Browser.setNotify({event:"onDocumentComplete"}, {callback:onDocumentComplete});

function onDocumentComplete(ret_obj, cb_obj, err_obj)
{
    // this will be called each time the browser loads a complete document
    // so it may be called multiple times, especially if the page uses
    // server side redirections

var r = ssCore.Browser.getURL({});
    ssDebug.trace("URL is " + r.result);
}

ssCore.Browser.setURL({url:"http://127.0.0.1"});
ssCore.Browser.open();

// this should be called before the initial navigation is complete
// so it will return an empty string for the URL (that is expected)

var r = ssCore.Browser.getURL({});
ssDebug.trace("URL is " + r.result);