uiwebview

Programmatically select text in UIWebView

馋奶兔 提交于 2019-11-29 16:56:29
问题 I'm asking this question after 2 days of research. I've read all the related questions and answers in stackoverflow and google (including this question, which is very similar but without an answer) and still couldn't find a solution. Hopefully someone here will be able to help. I have a UIWebView with some text loaded into it. I want to select part of the text programmatically, as if the user long-pressed on it. I've tried executing this javascript code as a response to a click: function

Android link navigation and box input on internet

别说谁变了你拦得住时间么 提交于 2019-11-29 16:49:16
How can I get android to "navigate" through links on website? Say the first activity in my app allows the user to input their username and password, which would then be stored into Strings. Then the app would "enter" the strings into the username and password boxes and "click" the login button on the website. This "filling" and "clicking" would be done in the background, while the user sees a loading screen. This is the basic idea. So how would I get the app to "fill" in the username and password boxes and "click" the login button? Also, I do not own the website that I'm logging into. My app

UIWebView VS WKWebView to load local html

一笑奈何 提交于 2019-11-29 16:45:34
i create a html string with 500 p tag with timestamp in it i use UIWebView and WKWebView loadHTMLString:baseURL: to load it,and wkWebView is slower about 50% than UIWebVIew . why? UIWebView:0.1681529879570007 WKWebView:0.3913570046424866 WKWebView is faster for displaying html from Strings. However, there is a bug that makes UIWebView faster by default, which is the phone number detection. Running a viewController with the following code, webView being respectively a UIWebView and WKWebView instance and keeping everything else identical I found WKWebView to take up to 2 seconds to load, while

Scrollable div on iPhone without using 2 fingers?

前提是你 提交于 2019-11-29 16:03:34
问题 I've got a UIWebView embedded in my iPhone app, and I'd like to keep a locked header and footer DIV on the page at all times, with a scrollable center DIV. I know that I could do this using a header/footer that are UIView controls, but I want the header and footer to be HTML divs, as a pure HTML/JS/CSS solution will be easier to port to Android/PalmPre/AdobeAir, which is going to be on my todo list relatively soon. I can do this using techniques like the one mentioned here: http://defunc.com

Injecting a new stylesheet into a website via uiwebview using iOS8 Swift XCode 6

半世苍凉 提交于 2019-11-29 15:55:14
I've seen a few options on here using just Objective-C, but I'm having trouble doing this with Swift iOS8 in XCode 6. I'm using the uiwebview to load a website. For sake of example, let's say its google.com. @IBOutlet var website: UIWebView! var url = "http://www.google.com" func loadUrl() { let requestURL = NSURL(string: url) let request = NSURLRequest(URL: requestURL!) website.loadRequest(request) } override func viewDidLoad() { super.viewDidLoad() website.delegate = self loadUrl() } func webViewDidFinishLoad(website: UIWebView) { var jsscript = "some script here" website

NSMutableURLRequest timeout doesn't trigger if data starts to load but not webViewDidFinishLoad

旧时模样 提交于 2019-11-29 15:53:48
I am loading a UIWebview and requesting a URL that can take some time to finish loading. The request starts and begins to receive data. However, it doesn't appear that the request finishes. The webViewDidFinishLoad never triggers nor does the webView didFailLoadWithError: callback. Does a timeout of a NSURLRequest only occur if there is no response receiving data or does it trigger if the request doesn't complete in that interval as well? If it's the former, is there an elegant solution to timing out the request? Relevant code is: Load the request: - (void) loadRequest { NSString *targetURL =

How can I start a YouTube video without the user touching the UIWebView itself?

匆匆过客 提交于 2019-11-29 15:29:24
问题 We're developing an app which contains a TableView with some standard cells, but also a list of YouTube videos. We know how to embed the YouTube video data into a UIWebView and play it when the user touches it. But in order to do that, users must touch the UIWebView. Since it's a TableView, every cell is the typical cell with the thumbnail on the left, some info and an accessory button on the right. We want to let users touch anywhere in the cell, not just the WebView (didSelectRow) so the

objective c send cookies to uiwebview

旧巷老猫 提交于 2019-11-29 15:19:26
问题 I need to send cookies for login to a UIWebView, but when I load the web page the cookies haven't been sent. My code is: CorreoViewController.m - (void)viewDidLoad { [super viewDidLoad]; self.title =AMLocalizedString(@"Correo", @""); NSURL *url=[NSURL URLWithString:@"https://cuentas.uv.es/cgi-bin/p/user/Usuario"]; NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:url]; NSArray * cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]; NSDictionary * headers =

playing a local video in a uiwebview

百般思念 提交于 2019-11-29 15:19:17
问题 i load a local html file into an ipad application: NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]; NSString *path = [[NSBundle mainBundle] pathForResource:@"lieferant1" ofType:@"html"]; NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil]; [webView loadHTMLString:content baseURL:baseURL]; the webpage gets displayed, content of my html file: <!DOCTYPE html> <html> <head> <title></title> </head> <body> <p>Lorem ipsum

Has iOS 7 changed PNG compatibility/handling?

耗尽温柔 提交于 2019-11-29 15:05:22
I've got an app that uses a UIWebView , and everything was (and still is) working perfectly on iOS 6. On iOS 7, though, it is sometimes kicking back an error ImageIO: PNG not a PNG file when I try to load certain PNG files, (for example this one ). Now, obviously the PNG files aren't corrupted because they work on iOS 6 and they sometimes work even on iOS 7, but then sometimes they kick back that error. I can't find any common cause that determines when the error happens, and I'm not doing anything unusual with them that might account for it: my code doesn't touch them other than to load the