uiwebview

Modify URL Before Loading Request in UIWebView

[亡魂溺海] 提交于 2019-12-06 09:22:38
I created a native app from my web app using UIWebView . My webapp is a basic CMS with some static pages, some category pages and and some detail pages. Now I need to check if the request comes from the web app or the native app. To do this I have two possibilities: First solution: Modify URL and check URL on server side: @IBOutlet var WebView: UIWebView! override func viewDidLoad() { super.viewDidLoad() loadWebPage() } func loadWebPage() { let url = NSURL(string: "http://localhost:8888?apptype=native") let request = NSURLRequest(URL: url!) WebView.loadRequest(request) } When I check on server

loggin into an iOS app using a system with ADFS

房东的猫 提交于 2019-12-06 08:55:09
问题 I am interested in making an app that logs into a system that uses Single Sign on with ADFS and SAML. Now I am happy to read up on it, I just was wondering if there is anything out there that is specific to the iOS platform and how this integrates, maybe even with a demo app. I have found this website: Single Sign-On for Desktop and Mobile Applications using SAML and OAuth I do realise that this is not an "coding problem" question, but I am sure they will come out of this when I start

Load Javascript files through HTML file on WKWebView in iOS

流过昼夜 提交于 2019-12-06 08:46:00
I have a requirement of loading Javascript files through HTML file. I have structured files in order shown in below screenshot. HTML head tag contains the Javascript files to call as below: <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> <script type="text/javascript" src="AjaxCapturer.js"></script> <script type="text/javascript" src="authenticate.js"></script> </head> So I have been using UIWebView to load the page and its loading properly as shown in below screenshot. Now if I run same thing using WKWebView then the page is keep on loading as

How to replace buttons on a toolbar under UIWebView keyboard on iOS 6?

霸气de小男生 提交于 2019-12-06 08:36:58
How to replace buttons on a toolbar under UIWebView keyboard on iOS 6? The following code works fine on iOS 5.1 but doesn't work on iOS 6: UIWindow *keyboardWindow = nil; for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) { if (![[testWindow class] isEqual:[UIWindow class]]) { keyboardWindow = testWindow; break; } } for (UIView *possibleFormView in [keyboardWindow subviews]) { // iOS 5 sticks the UIWebFormView inside a UIPeripheralHostView. if ([[possibleFormView description] rangeOfString:@"UIPeripheralHostView"].location != NSNotFound) { for (UIView

Embedding fonts in iPad

风流意气都作罢 提交于 2019-12-06 08:34:31
I am trying to embed Google fonts in a WebView in iPad. If I put this in the head all works fine: <link href='http://fonts.googleapis.com/css?family=Monofett' rel='stylesheet' type='text/css'> The html is local then I need to copy the CSS and the fonts in my iPad. When I do this changes the fonts doesn't work: html: <link href='fonts/fonts.css' rel='stylesheet' type='text/css'> fonts/fonst.css: @font-face { font-family: 'Monofett'; font-style: normal; font-weight: normal; src: local('Monofett'), url('http://themes.googleusercontent.com/static/fonts/monofett/v1/94n9d8-lEEaOz-Sn4plHGPesZW2xOQ

ASIHTTPRequest UIWebView load documents

房东的猫 提交于 2019-12-06 08:19:52
What is the best way to view documents (pdf,doc,xls) using AsiHttpRequest and UIWebView??? I tried the following, but the UIWebView is displaying the html: NSString * baseURL = @"http://xxxxxx/open-api/v1/"; NSString * itemRef = @"item/133/attachment/test.pdf"; NSString *urlString = [NSString stringWithFormat:@"%@%@", baseURL, itemRef]; NSURL *url = [NSURL URLWithString:urlString]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setUsername:@"xx"]; [request setPassword:@"xx"]; [request startSynchronous]; NSError *error = [request error]; if (!error) { [self.webView

How to save dynamic webpage in cache using UIWebview in Swift 3

∥☆過路亽.° 提交于 2019-12-06 08:19:27
问题 I am developing an application(Swift 3 using UIWebview). I need to load webpages into webview and save some webpages into cache. If there is not internet user will able to see those pages. But I am confused on how to save whole webpage in cache. The main thing is we need to show pages back even if there is not internet. I used the following documention : http://nshipster.com/nsurlcache/ and https://developer.apple.com/reference/foundation/urlcache let url = NSURL(string: load_url1) let

HTML file input with multi selection in UIWebView not working for videos

二次信任 提交于 2019-12-06 08:08:35
问题 I've been having issues with creating an upload form packaged as a native iOS app using UIWebView (Cordova). Problem is that when a video is selected in a element that allows multiple selection. Unlike when only single selection is possible, the selected videos are not "compressed" aka. preprocessed and thus restricted in some way. When trying to read such a video selected from the photo library using FileReader, the onerror function throws a "ProgressEvent" from the "FileReader" with the

How to save browsing history of UIwebview

孤者浪人 提交于 2019-12-06 07:49:35
I am developing an app where there is a requirement under which there is show wikipedia link in Web view.and also there is showing history of pages open via web view in a table view.I have find it on goo gle but can't find any solution.How can I solve it? Following code for the backward and forward into UIWebViewController - (IBAction)backButtonClicked:(id)sender { [webView goBack]; } - (IBAction)backButtonClicked:(id)sender { [webView goForward]; } Paresh Navadiya UIWebView has goBack and goForward method. Refer [here].( http://developer.apple.com/library/ios/#documentation/uikit/reference

How to change keyboard button “Return” to “Search” for input in a UIWebView?

痞子三分冷 提交于 2019-12-06 07:36:57
问题 I have this simple HTML file that is to be displayed in a UIWebView. <html> <body> <p> <input name='search' type='search' placeholder="Input type is search" /> </body> </html> Here is the screenshot when I clicked the input box. How to change the Return button to 'Search' like Google page does? 回答1: I found a simple solution. Just wrap the input with form tag so the HTML looks like this. <html> <body> <p> <form> <input name='search' type='search' placeholder="Input type is search" /> </form>