[TIMOB-9361] Android: WebView has no error event
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Reopened |
Resolution | Unresolved |
Affected Version/s | Release 2.1.0, Release 8.0.2, Release 8.1.0 |
Fix Version/s | Sprint 2012-14 Core, Release 3.0.0 |
Components | Android |
Labels | core, engSchedule, module_webview, qe-review, qe-testadded |
Reporter | kosso |
Assignee | Bill Dawson |
Created | 2012-05-30T04:39:42.000+0000 |
Updated | 2019-10-29T15:38:28.000+0000 |
Description
WRT Github pull request : https://github.com/appcelerator/titanium_mobile/pull/910
When an Android webView attempts to load a non-existent url (for example), no error is fired (as documented!)
// example: app.js
var win = Ti.UI.createWindow({
backgroundColor:'#fff'
});
var web = Ti.UI.createWebView({
// a clearly incorrect url
url:'http://google.cooom'
});
web.addEventListener('error',function(e){
Ti.API.info('ERROR: '+JSON.stringify(e));
alert('ERROR: type:'+e.type+'\nurl:'+e.url);
});
win.add(web);
win.open();
Testing Notes
* Run below app.js on *both iOS and Android*.* You should see an alert showing you an error code, the erroring url and the error message. The message and the numeric code value are platform specific, however the code should match the constant Titanium.UI.URL_ERROR_HOST_LOOKUP. If it does match that, the message will begin with a prepended "Titanium.UI.URL_ERROR_HOST_LOOKUP". <-- you should see that at the front of the message. * No sense testing in MobileWeb, that event never fires and anyway a code is not available there. * Run
python validate.py -e -s simple -f Titanium/UI/WebView.yml
andpython docgen.py
to make sure there are no errors *related to the WebView documentation*.PR ready https://github.com/appcelerator/titanium_mobile/pull/2509
Closing as fixed. Tested and verified on: Titanium Studio, build: 2.1.1.201208091713 Titanium SDK, build: 2.2.0.v20120813184911 Devices: Nexus 7 tab (4.1.1) The expected alert is shown.
reopening to update labels
Re-opening as on iOS the error code and error message show
undefined
. Or should I create a new ticket? [~vijaysingh]Still showing as undefined.