uiwebview

even basic Ionic project with Cordova WKWebview Engine plugin produces white screen

妖精的绣舞 提交于 2019-12-03 12:24:00
问题 My problem: The ionic app I'm developing is horribly slow, after finding out UIWebView is the culprit I'm looking for ways to speed it up, with WKWebView being the most promising solution. What my project looks like: When setting up a sample ionic project (http://ccoenraets.github.io/ionic-tutorial/install-ionic.html for example) with the current Cordova 4.1.0 CLI (i'm using Ionic 1.2.4) UIWebView is used as default. However, since Cordova 4, the new and faster WKWebView is supported out-of

Android's addJavascriptInterface equivalent in iOS

被刻印的时光 ゝ 提交于 2019-12-03 12:18:07
As you may know, Android's WebView has a method named addJavascriptInterface() which imports an Android JAVA object to Javascript context. the question is, Is there any equivalent of it on iOS? UIWebView on iOS doesn't have methods to add interface to DOM. But you still can talk to your code from javascript assigning something to window.location and handling that request in webView:shouldStartLoadWithRequest:navigationType: delegate method. I know this question is really old, but it seems that there is a better way to do it now with a WKWebView . See this answer: https://stackoverflow.com/a

Open activity without showing UIActivityViewController

末鹿安然 提交于 2019-12-03 11:58:21
问题 I want to be able to have social icons in a scrollView, which when clicked, functions the same way it would if I had clicked on them after presenting a UIActivityViewController. I don't want to present a UIActivityViewController. I know it shouldn't be possible, but an app called Yodel does this (or something similar) and I want to do the same. Clicking on the icons in Yodel works exactly the same as it would in a UIActivityViewController, so it seems they have somehow put it inside a

Using UIActivityIndicatorView with UIWebView in Swift

无人久伴 提交于 2019-12-03 11:49:24
I'm trying to display an Activity Indicator View in my app to users while a url is being loaded into a WebView. I've tried toying with activity.startAnimating/activity.stopAnimating and tried placing them in functions, etc. but have not had any luck. The best I have been able to get is the Activity Indicator to appear and animate, but then not stop animating or hide once my url is loaded, so it continues spinning on top of the web page. In other situations, when trying to move around activity.startAnimating, I have encountered the "Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode

Display PDF in UIWebView using loadData

混江龙づ霸主 提交于 2019-12-03 11:42:56
I am trying to display a PDF I have stored locally in a UIWebView. This is how I currently attempt to do this: if (![[NSFileManager defaultManager] fileExistsAtPath:self.url]) { LOG_ERROR(@"Couldn't load local file. File at path: %@ doesn't exist", self.url); return; } nsurl=[NSURL fileURLWithPath:self.url]; NSData *data = [NSData dataWithContentsOfFile:self.url]; LOG_DEBUG(@"data length:%d",[data length]); [self.webView loadData:data MIMEType:@"application/pdf" textEncodingName:@"utf-8" baseURL:nil]; I have also tried passing nil for textEncoding, as well as using UIWebView's loadRequest. The

UIWebView crashing on second pdf load request

女生的网名这么多〃 提交于 2019-12-03 11:33:14
问题 I have a UIWebView I'm using to show several small PDF's. The user selects a news article from a table and then the article(PDF) is loaded in a UIWebView on the same screen. The first load always goes just fine. Then the next item I select (no matter which one) crashes the app. This is how I'm loading each article: NSString *filePath = [[NSBundle mainBundle] pathForResource:articleFileName ofType:@"pdf"]; [articleView stopLoading]; [articleView loadRequest:[NSURLRequest requestWithURL:[NSURL

iOS 7 UIWebView doesn't load webpage

会有一股神秘感。 提交于 2019-12-03 11:31:45
My app uses UIWebview, and it works well in iOS 5 and iOS 6. However, it doesn't load the webpage in iOS 7 when I build in Xcode 5 and run the same code. - (void)webViewDidFinishLoad:(UIWebView *)webView {} - (void)webViewDidStartLoad:(UIWebView *)webView {} - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {} All delegate function is not called. But I do set delegate in xib file and code self.theWebView.delegate = self; I didn't find any information via google. Thank you for your help. I moved the loadRequest method to the completion handler of a presentViewController

How to handle YouTube video events (started, finished, etc) in uiwebview iOS

雨燕双飞 提交于 2019-12-03 11:06:47
问题 Currently I'm using the new iframe API to embed a YouTube video inside the uiwebview on the iPad and I've been able to make it auto play without user interactions. In the iframe API it is described how to use the onstatechange event but in my application it doesn't seem to work and unfortunately I can't see any debug in uiwebview. I just want to able able to detect when the video ends, have you got any advice on it? Has anyone got it to work? 回答1: Have you tried (from the documentation) to

Feature detect opening in a new window/tab(target=_blank) with JavaScript

萝らか妹 提交于 2019-12-03 10:31:23
According to my research: "WebView" can disable "opening links in new windows/tabs". WebView is used by native app developers to display webpages within their app(see Twitter's app). Detecting WebView via user agent doesn't work consistently and isn't a best practice anyway. Simply attempting to open a new window with JS triggers popup blockers; making it an unreliable way to test if a new window can be opened. I need to detect when this feature is not available. Impossible? Additional Explanation I'm trying to detect whether I can open a new window via target=_blank. For example, UIWebView

How to activate spellchecking for a contentEditable div in a UIWebView?

爷,独闯天下 提交于 2019-12-03 10:15:25
UIWebView (iOS 5.0) does not show the red-squiggly spelling correction underlines for this: id html= @"<div spellcheck=\"true\" contenteditable=\"true\"></div>" [webView loadHTMLString:html baseURL:nil]; Is it possible to get them? There are some HTML tag properties available by Apple Safari Guidelines autocomplete : If off, deactivates automatic completion for an input element; If on, activates automatic completion for the element. Related Tags “input” Availability Available in Safari 1.0 and later. Available in iOS 1.1.1 and later. autocorrect : If off, deactivates automatic correction for a