[TIMOB-11665] iOS: Loading local pdf in a webview throws encoding error in the console
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-08-12T22:36:37.000+0000 |
Affected Version/s | Release 2.1.3, Release 3.1.0 |
Fix Version/s | 2013 Sprint 16, 2013 Sprint 16 Core, Release 3.2.0 |
Components | iOS |
Labels | n/a |
Reporter | Anirudh Nagesh |
Assignee | Blain Hamon |
Created | 2012-11-05T17:39:17.000+0000 |
Updated | 2013-10-18T21:10:21.000+0000 |
Description
Run the below code snippet with a sample pdf file in resources folder. Error is seen in the console, however pdf is displayed properly in the webview.
var mWin=Ti.UI.createWindow();
var mWebView=Ti.UI.createWebView({
});
mWebView.url='1.pdf';
mWin.add(mWebView);
mWin.open();
issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 iOS iPhone Simulator: iOS SDK version: 6.0
Okay, this is due to TiUIWebView.m:533. Namely, we check any local file to see if they're HTML that needs injection. It fails gracefully, which is why the PDF loaded, but we should have a blacklist of file types to not inject.
Pull #4517 pending
Closing ticket as fixed. Verified local pdf gets loaded in webview and no encoding errors appear in the console. Tested on: Titanium Studio, build: 3.2.0.201310180511 OS: Mac OS X Mountain Lion (10.8.5) SDK build: 3.2.0.v20131018121230 Devices: iphone 4 (5.1.1), iphone 5 (7.0.2)