uiwebview

How to get url which I hit on UIWebView?

那年仲夏 提交于 2019-12-11 12:28:46
问题 NSString *testString =[NSString stringWithFormat:@" <a href = \\\\ \"www.google.com\">Google</a>"]; [webView loadHTMLString:testString baseURL:nil]; I want to get the URL when I click on this UIWebView content in -(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType { if ( inType == UIWebViewNavigationTypeLinkClicked ) { [[UIApplication sharedApplication] openURL:inRequest.mainDocumentURL]; return NO; } return

UIWebView acts differnetly in app store version than dev version

谁都会走 提交于 2019-12-11 12:15:20
问题 I've got a problem with an app that works perfectly in the simulator as well as a physical iPhone 4 and an iPhone 3GS. The app was approved and is now in the App Store, but the distribution build downloaded from the App Store exhibits a bug not seen in the dev/release build. This is a free app, but is supported by local advertising. When the app launches (or returns from background), the AppDelegate attempts to download some HTML from our ad server, and if successful, presents a modal view

YouTube video in UIWebView

我只是一个虾纸丫 提交于 2019-12-11 12:12:10
问题 I have set up a UIWebView to show my YouTube's Channel, I'm using this code [youTube loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.youtube.com/v/user/MyChannel/"]]]; This work when I build and go on the simulator but when I want to play a video on my device, the video never show up... The console say that when I compile with my device warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.0 (9A5313e)/Symbols/System/Library

How can I set the font and line spacing on HTML I load into a webview?

匆匆过客 提交于 2019-12-11 12:08:47
问题 I have an iOS app that parses articles from a remote rss feed. When I format it through a webview and "LoadHTMLString:withURL," the text is formatted with some default font/line spacing. I want to set my own font/line spacing, and I think that this can be done if I include the correct HTML formatting code as a string in the beginning of each article. This way I'll manipulate XCode to format the string for my liking. The only thing is that when I add the line <p style="font: 20pt/30pt Times

How to control UIWebView's javascript

孤者浪人 提交于 2019-12-11 12:03:43
问题 It is that UIWebview and toggle button on UIView. WebPage includes javascript. I want to control UIWebView's javascript. What I want is that whenever Button on UIView is toggled, javascript is turned on or off. Is it possible? If so, how can i do? It is sad that I don't have idea. This is my javascript code: - (void)viewDidLoad { [super viewDidLoad]; NSString *var = nil; var = @"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>" "<html> " "

iOS UIWebView - restricting HTML path

早过忘川 提交于 2019-12-11 11:35:45
问题 I have an UIWebview and it's loading a particular website section (news). And I want to block the users to access other part of the site, meaning they should only stay in the news section / reading the pdf articles. I've constructed a set of code, but sadly unable to test them out just yet due to some technical constraint. Will only be able to access it next week. However, I thought it will be a good time to ask here and let the advance user view my draft code and see if its feasible. - (void

Need to view website with a self-signed certificate and http authentication

妖精的绣舞 提交于 2019-12-11 11:18:47
问题 I am having trouble viewing a website that has a self-signed certificate and also requires HTTP authentication. Currently I am trying to implement it by using How to display the Authentication Challenge in UIWebView? and UIWebView to view self signed websites (No private api, not NSURLConnection) - is it possible? as guides on how to accomplish this. I'm also trying to use the private api method of bypassing self-signed certificates but I'm having trouble finding the link to it. But the

uiwebviewdelegate not called from non-visible uiwebview

情到浓时终转凉″ 提交于 2019-12-11 11:08:09
问题 I am trying to avoid the blank white window that shows while a UIWebView loads content. Instead of putting a background on the UIWebView, I'd like to just put up a HUD on the current window and then push the new uiviewcontroller that contains the uiwebview when the content is loaded. Here's what I've done (code shortened for sanity's sake): FirstView: MyViewController *myVC = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; myVC.parentController = self

Get MIMETYPE by requesting header of the file/web page reside at URL

孤人 提交于 2019-12-11 10:38:06
问题 I need to know the MIMEType of the file or web page , available at particular URL and according to MIMEType I’ll take the decision whether to load that page/file to the UIWebView or not. I know, I can get MIMEType with NSURLResponse object, but problem is, when I get this response that page would have already downloaded. So, is there any way to ask only header of the file/webpage at particular URL , so that I can check the MIMEType and request for that page/file, only when it is required? 回答1

How to play YouTube video in iOS not in fullscreen?

落花浮王杯 提交于 2019-12-11 10:22:59
问题 I've been trying to get YouTube music videos to play in my iOS app in a small window (not full screen) and can't get it to work. I've tried the following: I first used the YouTube API and created a YTPlayerView as instructed here: https://developers.google.com/youtube/v3/guides/ios_youtube_helper#adding_ytplayerview. This allowed me to play videos in-line, but many videos were unable to be played because of licensing issues, stating "This video contains content from *. It is restricted from