uiwebview

How to resolve “Frame Load Interrupted” error in UIWebView?

浪子不回头ぞ 提交于 2019-12-04 02:59:46
问题 In an app I'm contracted to build, I'm pulling a list of YouTube videos and allowing them to be displayed in the app. However, when a user taps a cell in the YouTube view's navigation controller and the modal view with a UIWebView appears, the UIWebView returns the error "Frame load interrupted." I've run it through the debugger dozens of times, and everything seems to go well until I initialize the NSURLRequest. When the modal view is displayed, here is the code that runs in the

Xcode, Swift; Detect hyperlink click in UIWebView

大憨熊 提交于 2019-12-04 01:30:37
问题 I made an iOS app with Xcode and Swift. I want to open specific hyperlinks in Safari browser, there others in the WebView itself. To reach this, I'll have to check when an hyperlinks gets clicked. This is the code I have so far: // // PushViewController.swift // App // // import UIKit class PushViewController: UIViewController, UIWebViewDelegate { @IBOutlet var openpushmessage: UIWebView! var weburl:String = "http://www.example.com" override func viewDidLoad() { super.viewDidLoad() let url:

Youtube video in landscape mode within a UIWebView

旧街凉风 提交于 2019-12-04 00:31:40
My application was not made ​​for the landscape. But when I open my YouTube channel in a UIWebView and a user launches a video , it appears in Portrait. I would like to make it appear in landscape mode if the user rotate his iPhone. How to enable landscape mode as in this case? I know there are "dirty hacks" to do this but I prefer something cleaner. Also I do not want the UIWebView switches to landscape but just that the videos can. I finally adjusted my view so that it supports landscape mode using the following code : - (void)viewDidLoad { [super viewDidLoad]; [[UIDevice currentDevice]

iOS: WebView Loading a url

两盒软妹~` 提交于 2019-12-04 00:22:23
I am trying to open the following url in UIWebView but it fails to load whereas changing it to: http://www.google.com works fine. The url that I want to load is: [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@%@%@%@",@"http://m.forrent.com/search.php?address=",[[bookListing objectForKey:@"Data"] objectForKey:@"zip"],@"&beds=&baths=&price_to=0#{\"lat\":\"0\",\"lon\":\"0\",\"distance\":\"25\",\"seed\":\"1622727896\",\"is_sort_default\":\"1\",\"sort_by\":\"\",\"page\":\"1\",\"startIndex\":\"0\",\"address\":\"",[[bookListing objectForKey:@

Is there a way to refresh your phonegap application - eg, build the page and start running the scripts from the beginning?

自作多情 提交于 2019-12-04 00:10:18
Is there any way to do this? E.g., if a user starts the app with no internet connection, no remote scripts can be loaded, and the application basically can't run and I display a "No internet" page. But if the user gets internet later and the application is still running, is there any way to just "restart" ? how about - document.location = "index.html" PhoneGap applications are just like an embedded website - you should be able to go to any hyperlink you wish (mind the whitelists). Of course, if you also want to detect when it's again online, you should use the PhoneGap Network API to bind to

Issue with not getting sound in device when play youtube video in UIWebView in IOS

冷暖自知 提交于 2019-12-03 23:33:36
问题 I am using a UIWebView to play Yoytube Video. My code is like that self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0,320, 240)]; [self.webView setBackgroundColor:[UIColor clearColor]]; [self.webView setOpaque:NO]; self.webView.delegate=self; [self.webView setAllowsInlineMediaPlayback:YES]; [self.webView setMediaPlaybackRequiresUserAction:NO]; [self.viewContent addSubview:self.webView]; NSString* embedHTML = [NSString stringWithFormat:@"\ <html>\ <body style='margin:0px;padding

Where can I learn more about WebCoreSharedBufferData?

匆匆过客 提交于 2019-12-03 23:08:05
I've got an app that was working perfectly on iOS 6, but on iOS 7, if there is a very specific action taken by the user (too complex to get into but it uses a UIWebView and it's consistent), the app crashes with the error: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[WebCoreSharedBufferData getBytes:range:]: range {0, 8} exceeds data length 0' Now I'm more than happy to do some research and experimentation myself, but I just can't find WebCoreSharedBufferData . Google searches reveal several people (like here and here and here and here ) who are having

CSS3 Columns and UIWebView

守給你的承諾、 提交于 2019-12-03 22:47:39
Using CSS3 columns to take a somewhat large text document and make it scroll horizontally. I want each column to be close to the size of the iPad screen, as I am displaying the content in a UIWebView. If I make the -webkit-column-width: property a relatively small number, everything works great. The text stops at the max-height set for the containing and columns out horizontally. If I make -webkit-column-width anything larger than about 300px, though, this css seems to get completely ignored. The text displays vertically as it would without styling. Any fixes? Display when -webkit-column-width

Is it possible to use stringByEvaluatingJavaScriptFromString with Javascript which references local files?

血红的双手。 提交于 2019-12-03 22:22:33
I want to use stringByEvaluatingJavaScriptFromString to run a javascript which references local files (in this case css files, but potentially js files too) which are on the device (in the Documents folder I guess?)... NSString *theJS = [[NSString alloc] initWithString:@"javascript:(function() {the_css.rel='stylesheet'; the_css.href='the_css.css'; the_css.type='text/css'; the_css.media='screen';} )();"]; [webView stringByEvaluatingJavaScriptFromString:theJS]; How would I get this to work? It works fine if I use an external css file, like the_css.href='http://www.website.com/the_css.css'; What

Force correct CSS3 transform percentage interpretation on Android

拜拜、爱过 提交于 2019-12-03 22:09:55
tl;dr ? Get the mechanism demonstrated in the link below to behave with GPU acceleration on Android Chrome & default browser. UPDATE 2 (2014-01-13 13:25:30Z): According to bref.it 's comment below, the reported behaviour is fixed as of Android 4.4 KitKat — but the fix I described below now breaks it! Sod's law. UPDATE 1 (2012-11-01 17:54:09Z): The buggy behaviour is inferrable from the transformation matrix as reported by the computed style of the transformed element, which returns a pixel value. I'll try to write a Modernizr test for this to pave the way for any possible solutions. I've