uiwebview

Disabling ATS for an in-app browser in iOS 9?

这一生的挚爱 提交于 2019-12-01 00:31:57
iOS 9 introduces App Transport Security (ATS) to encourage the use of secure connections. This is great, but what if my app has a built in web browser that the user should be able to use to connect to any website? For example, the Facebook app allows stories to contain links to external websites. When the user taps such a link, rather than launching Safari, it launches an in-app browser. How can I get this same behavior without enabling the global NSAllowArbitraryLoads flag ? I want all the benefits of enforcing https usage, but want to disable this check in my internal browser. In an ideal

Show keyboard automatically with focus() event in UIWebView using Trigger.IO/PhoneGap

旧时模样 提交于 2019-12-01 00:18:52
Supposedly, this has not been possible since iOS 6 where you can set the UIWebView's keyboardDisplayRequiresUserAction = NO. I'm using a html 5 webview (Trigger.IO) and building a native plugin but am having difficulty grabbing hold of the UIWebView instance. How do I grab hold of the webview so I can simply do the following: mywebview.keyboardDisplayRequiresUserAction = NO; Probably really simple.. what am I missing? Connorhd Access to the UIWebView isn't something we properly expose in the current version of plugins (but is something we will support soon). For now if you want to try it out

How to set http header in uiwebview if loading view with loadHTMLString

蹲街弑〆低调 提交于 2019-12-01 00:00:53
I have a UIWebView that i am loading using loadHTMLString and i need to set cookies on the request header. I know how to do this using loadRequest but not loading the webview with loadHTMLString I don't have the request object. Has anyone done anything like this? There will not be any difference between loading web view from loadRequest vs loadHTMLString method, shouldStartLoadWithRequest method will be called in both cases. You can override your headers there and add header as per your requirements. 来源: https://stackoverflow.com/questions/24682722/how-to-set-http-header-in-uiwebview-if

Monotouch + UIWebView = Random Crashes

最后都变了- 提交于 2019-11-30 22:21:10
I'm using the latest stable releases of Mono/Monotouch/MonoDevelop on a iOS 5.0 iPhone and iPad. I have a UIWebView that in the emulator never crashes however randomly on the actual devices it crashes on EXC_BAD_ACCESS. Based on everything I've read with UIWebViews that most likely occurs when the UIWebView gets disposed before it finishes loading. Here is the code I am using in my ViewDidLoad(): var urlAddress = BASE_URL + _page; var nsURL = new NSUrl(urlAddress); var nsURLRequest = new NSUrlRequest(nsURL); _webView.Tag = 10; _webView.ScalesPageToFit = true; _webView.AutosizesSubviews = true;

UIWebview enable cookies

烂漫一生 提交于 2019-11-30 21:59:21
I am trying to access a specific URL that requires cookies through UIWebView but I can not access it because cookies are disabled. So I did the following: Enabled cookies: NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; Created NSURLConnection and extracted cookies from response: NSArray *cookies = [ NSHTTPCookie cookiesWithResponseHeaderFields: [ httpResponse allHeaderFields ] forURL:response.URL]; [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies: cookies forURL: response.URL

Set Cookie for UIWebView requests

…衆ロ難τιáo~ 提交于 2019-11-30 21:42:18
I want to embed an UIWebView into my MonoTouch application for an area that is not yet implemented natively. In order to authenticate with the website I want to set a cookie containing a key for the current session. I tried creating a NSDictionary with the properties for the Cookie and then create a new NSHttpCookie and add it to the NSHttpCookieStorage.SharedStorage . Sadly the cookie seems to be empty and not used for the request. An example of how to build be cookie with properties and a comment on whether or not this is the simplest way to do this would be greatly appreciated. Whenever I

Removing hyper links from a URL shown in UIWebView

爷,独闯天下 提交于 2019-11-30 21:09:23
问题 I am making an app which has a section for latest company news. Basically the plan was initially to use ASIHTTPRequest to extract all the HTML, search through it for tags then pull the information out for news title and description then display it as just plan text in a scroll view of my app. However, this was proving to be a nightmare as the site has no pattern to the way the information is displayed. I have since decided to display the URL in a UIWebView which shows the latest company news.

Objective-C Issues with UIWebView to PDF

╄→尐↘猪︶ㄣ 提交于 2019-11-30 20:32:02
I have this method here that takes my UIWebView and convert into a PDF and its working well. But when I print off this PDF or email it, its cut off. Its like its only generating what the size of the UIWebView that I set (which is width: 688 & height: 577) If I increase the size of the UIWebView to lets say 900 or 1024 my PDF is empty. My UIWebView is bigger than 577, but in my app, I am able to scroll. Here is method.... -(void)webViewDidFinishLoad:(UIWebView *)webViewPDF { CGRect origframe = webViewPDF.frame; NSString *heightStr = [webViewPDF stringByEvaluatingJavaScriptFromString:@"document

Apple File system Permission to read from Photo Library

此生再无相见时 提交于 2019-11-30 20:30:34
问题 I have a UIWebView inside my ios application , which loads responsive website into my webview, developed in asp.net . Website has a button to choose video from device Photo Library and another button to upload video. In till ios version 10.2 it is uploading files successfully to server. Apple introduce new version ios 10.3 with new file system APFS before it was HFS+ File System. In ios 10.3 it doesnot allow my application to read video file and 0kb size is uploaded to server. This is because

WKWebView showing blank on device, working on simulator

被刻印的时光 ゝ 提交于 2019-11-30 20:13:40
问题 One of the modules of my app is a web site. That web site contains primarily an SVG drawing, with custom shaped buttons (using Raphael.js library) to access other drawings (other html page with svg drawings). If the device is on iOS 7, I use a UIWebView and everything works fine. For iOS 8 devices, I use a WKWebView. I had some issues, some of them resolved by this post. I can see my web site on those simulators (iPhone 5 / iOS 8.0 (12A365) & iPhone 5s / iOS 8.0), but I can't see it on my