Developer's Blog

【iOS】UIWebView Hacks 〜ブラウザ開発テクニック〜






Sleipnir Mobile for iPhone / iPad 

調Sleipnir Mobile  2010963 API 使

3使 UIWebView UIWebView 









UIWebView  API 



/

/

HTML

JavaScript  

///



JavaScript 

JavaScript  Objective-C 















Basic 







PDF 





Web  PDF 





UIWebView  property 







JavaScript 


 API  JavaScript 
js

JavaScript  Objective-C 




JavaScript
location.href=sleipnir://send?text=hello 
webView:shouldStartLoadWithRequest:navigationType:
 request.URL.scheme  sleipnir URL  scheme NO


UIWebView  UIView  layer  renderInContext: 
webView:didFinishLoad:  renderInContext: 


[webView stringByEvaluatingJavaScriptFromString:@document.title];


iOS 4  iOS 5, 6 


iOS 4
NSURLRequest  valueForHTTPHeaderField:  swizzle 

iOS 5, 6
NSUserDefaults  registerDefaults  UserAgent 使



(一)JavaScript  Element 

(二) webContentView:shouldStartLoadWithRequest:navigationType:
 Element  target 



UIScrollViewDelegate  swizzle 


UIWindow sendEvent: Sleipnir Mobile  Notification 
Sleipnir Mobile L



(一)document.body.style.webkitTouchCallout=none 

(二)  JavaScirpt 

(三)Hold And Go 


 Sleipnir Mobile 
https://blog.fenrir-inc.com/jp/2011/06/sleipnir_mobile_13_hold_and_go.html

Basic 


NSURLProtocol registerClass 
startLoading  stopLoading  NSURLConnection connection:didReceiveAuthenticationChallenge: 



(一) delegate  POST  JavaScript 

(二) JavaScript 


NSURLCache  setSharedURLCache  NSURLCache 


WebKit NJKWebViewProgress 
https://github.com/ninjinkun/NJKWebViewProgress

PDF 


UIWebView 


(2013/11/15)
iOSJavaScript 使UIWebView 





Web  PDF 


Mac


Mac 


UIWebView 

UIWebView  property 


Mac  WebView 


Web 
UIWebView  loadData:MIMEType:textEncodingName:baseURL:
 NSData 

UIWebView Sleipnir Mobile for iPhone / iPad 



Copyright © 2019 Fenrir Inc. All rights reserved.