PDA

View Full Version : How to use Ext.device.Browser listeners



hchoong
24 Oct 2013, 11:38 AM
How can I bind the listeners to the InAppBrowser (Cordova plugin)?


Ext.device.Browser.open({
url: uri,

listeners: {

'loadstart': function(event){console.log(event.url);},

'close': function(event){console.log("Exit");}

},

options: 'location=no'
});

Can anyone give me some examples on how to use the listeners option?
Thanks.

mitchellsimoens
28 Oct 2013, 12:19 PM
Ext.device.Browser doesn't have events, the Ext.device.browser.Window does which is cached on the _window property.

WayneRoo
28 Oct 2013, 5:38 PM
how to use Ext.device.Browser ,when i want to open a url,firebug show Uncaught TypeError: Cannot read property 'Browser' of undefined

frankpeng
20 Jan 2014, 6:50 AM
Have you tried adding the followings?


requires: [
'Ext.device.Browser',
'Ext.device.browser.Window'
],


Mine doesn't complain about 'Browser' of undefined, but it just doesn't do anything on my android device. On my desktop, Ext.device.Browser.open("http://www.yahoo.com") just opened an untitled blank webpage.

gabriel90
25 Nov 2015, 11:29 PM
Is there any update how to use of these listeners? I did the following code, but the listeners don't work...




Ext.device.Browser.open({
url: 'http://www.google.com.br',
listeners: {
'loadstart': function(event) {alert('loadstart');},
'loadstop': function(event) {alert('loadstop');},
'loaderror': function(event) {alert('loaderror');},
'close': function(event) {alert('close');}
},
showToolbar: false,
target: '_blank',
options: 'location=no,hardwareback=no'
});