uiwebview

Autofill Username and Password UIWebView Swift

此生再无相见时 提交于 2019-12-03 20:25:28
问题 I've found many ways to autofill a username and password in objective-c, but I can't figure out how to make it work with Swift. What would be the Swift equivalent of this code and would this work for what I am trying to accomplish? Thanks - (void)webViewDidFinishLoad:(UIWebView *)webView { // Auto fill the username and password text fields, assuming the HTML has // <input type="text" name="username"> and // <input type="text" name="password"> NSString *savedUsername = [[NSUserDefaults

iOS Hiding tab bar in iOS 6 creates black bar (fix for iOS 6 breaks iOS 7!)

烂漫一生 提交于 2019-12-03 18:57:28
问题 I've got a tabbed application and in one tab there is a UIWebView . When I rotate the device to landscape I've made the UIWebView full screen while hiding the status and tab bar. I've got it working in iOS 6 - originally when rotating and hiding the tab bar it would leave a black space where the tab bar was, so the fHeight code fixes this. However, on iOS 6 it worked perfectly, but now it actually creates the black bar problem iOS 6 was having!! Any ideas for a workaround to this? Please see

MPMoviePlayerController fullscreen movie inside a UIWebView

£可爱£侵袭症+ 提交于 2019-12-03 18:26:31
问题 I'm having a problem with the UIWebView and MPMoviePlayerController: My UIWebView have a movie inside the html (it's a local html file), I'm using html5 and a video tag for the video. The problem is: the user can set the video to play inline, directly on the html or he can tap the fullscreen button, but I need to know if the video is playing fullscreen. I've tried to use MPMoviePlayerDidEnterFullscreenNotification but with no success. Does anybody know how to get this notification from the

iOS7 UIWebView Memory leak

百般思念 提交于 2019-12-03 17:43:50
问题 We have an comprehensive iOS app with Hybrid mode - a UIWebView hold the major part of the web application in JS. It works fine on iOS6, but recently we found serious out of memory crash on all iOS7 device - iPad, iPhone 4/4S and iPhone 5/5C/5S. We did analysis of the memory consumption both on iOS6 and 7 in the iOS simulator. By doing same interaction in the app, the memory consumption of the WebView is always less than 200MB in iOS6, while it can exceed 800MB on iOS7! We guess there is some

Memory Leaks with UIWebView and Javascript

自古美人都是妖i 提交于 2019-12-03 17:28:41
问题 I am trying to fix a bunch of leaks that my UIWebView is causing and cannot find their origin nor a workaround. What I do is getting some content from the web through a network request, then assemble my HTML and load it on the fly: NSString* body = <some HTML>; NSString* html = [NSString stringWithFormat:kHTMLTemplate, [self scripts], [self styles], body]; [_webView loadHTMLString:html baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]]; Each time there is new content

Is there a bug with using InnerHTML inside a UIWebView within a native iPhone application?

依然范特西╮ 提交于 2019-12-03 17:28:29
问题 I have a fairly large HTML/JS/CSS application that works great when running as a web application with Safari on the iPhone. When running this same application in an UIWebView within a native iPhone application calls within jQuery to create HTML fragments fail silently (ie: $("<div>HELLO WORLD</div>"); will not create the element. I've tracked this down to the following equivalent code snippet in clean jQuery method: var div = document.createElement(“div”); div.innerHTML = “<div>HELLO WORLD<

Detect long press on UIWebview and pop up a menu if I'm pressing on a link

你。 提交于 2019-12-03 17:22:52
Running into a problem with UIWebview, it doesn't seem to react to gesture recognizer. I would like to get a popover to appear whenever I do a long press on a link (or image) with different actions. Any help would be greatly appreciated =). Thanks. You can detect clicking on a URL like this - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType { if (navigationType == UIWebViewNavigationTypeLinkClicked) { NSURL *URL = [request URL]; if ([[URL scheme] isEqualToString:@"http://"]) { //It is a URL }else{ //Not a

uimenucontroller in uiwebview with custom menu items without MORE menu

回眸只為那壹抹淺笑 提交于 2019-12-03 17:20:43
In my iPad app, there is a UIWebview that displays text content. When I tap hold and select a text, a menu should popup with 2 custom menu. say, | MENU1 | MENU2 | But it seems the COPY menu will also accompany, which I couldn't disable. Is there any possibilities to disable it? I tried around the forum and no solutions worked out. so itz okay to keep the COPY menu along with the other 2. which should now look like | Copy | MENU1 | MENU2 | But unfortunately, I 'm getting it displayed with a MORE menu as follows : | Copy | More... | Clicking the More... menu is showing the other 2 menu. But I

Remove selection gray shadow from html input on iOS

两盒软妹~` 提交于 2019-12-03 17:16:35
I'm currently working on html rich text editor for my iOS application,so,the setup is simple,i have a UIWebView loading my editor code,the html input is a 'contentEditable' DIV . The problem is that every time i select this div to enter some text,a light gray frame appears on the input frame,telling the user that the textfield has been selected. NOTE :You can see the effect in this quick video My question is: How to remove this light gray frame? My html file is bellow: <html> <head> <style type="text/css"> :focus{ outline:0px solid transparent; } DIV::-moz-focus-inner { background-color:

“SyntaxError: Unexpected EOF” when evaluating JavaScript in iOS UIWebView

情到浓时终转凉″ 提交于 2019-12-03 17:02:42
问题 I keep getting this error in JavaScript when trying to pass some JSON to a UIWebView : SyntaxError: Unexpected EOF There is no line number or filename available in window.onerror but I've already checked all referenced files, and they are fine. I'm using MonoTouch EvaluateJavaScript method which is equivalent to ObjC stringByEvaluatingJavaScriptFromString:: webView.EvaluateJavascript( "Viewer.init($('#page'), " + json.ToString() + ");" ); It works just fine on “simple” JSON input but breaks