Am using 3.1.3.GA sdk, Alloys 1.2.2, 4.0 Android Emulator and 7.0 iPhone simulator. Am using wenviews beforeload and load events to check the URL its loading. But if we navigate from one URL to next, in beforeload event already loaded URL only present and not having the current loading URL. I need to make the webview to stop the URL from loading. How to achieve this? For example,
webview.addEventListener('beforeload', function(e){ var url = webView.url; if(url.indexOf('test') >= 0){ close(); } });Am redirecting to the URL, but after loading only the URL variable getting updated and used to close the webview. If I run the same code in load event, its running correctly,
webview.addEventListener('load', function(e){ var url = webView.url; if(url.indexOf('test') >= 0){ close(); } });But I need to run it in beforeload event only. Is it posible?