uiwebview

removeChild sometimes removes entire span and sometimes doesn't

泪湿孤枕 提交于 2019-12-04 11:42:32
I'm working on a rich text editor for iOS and have most of it working but running into endless problems ensuring that the cursor is visible in the viewport when the user starts typing. I came up with a novel approach: insert a span at the cursor position, scroll to the span, and then remove it. (I haven't gotten to only scrolling if the span is on-screen.) Here's what I wrote: document.addEventListener('keypress', function(e) { jumpToID(); }, false); function jumpToID() { var id = "jumphere2374657"; var text = "<span id='" + id + "'> </span>" document.execCommand('insertHTML', false, text);

Unable to load full Facebook comment plugins inside an iOS UIWebView

可紊 提交于 2019-12-04 11:13:59
I have a simple ViewController to load FB comments plugins inside a UIWebView @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; UIWebView * webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320.0f, 1505.0f)]; NSString * html = @"\ <!DOCTYPE html>\ <html xmlns:fb='http://ogp.me/ns/fb#'>\ <head>\ <meta name='viewport' content='width=device-width, initial-scale=1.0'>\ </head>\ <body style='background-color:red;'>\ \ <div id='fb-root'></div>\ <script>(function(d, s, id) {\ var js, fjs = d.getElementsByTagName(s)[0];\ if (d.getElementById(id)) return;\ js = d

Console error “CGAffineTransformInvert: singular matrix” in UIWebView

做~自己de王妃 提交于 2019-12-04 11:09:49
First and foremost, I have searched this thoroughly and I'm not convinced with any solution to start. I have a simple UIWebView wrapper and we have our code deployed on a static server. The URL of our server is the loading URL of the UIWebView, if there isn't any valid JSessionID, it redirects to the login page(from the client) which redirects back to our server when a successful JSessionID is captured. The console displays the following error Anshuks-MacBook-Pro-2.local xyz[40332] <Error>: CGAffineTransformInvert: singular matrix. Anshuks-MacBook-Pro-2.local xyz[40332] <Error>:

IOS6 landscape playing embedded youtube video from a uiwebview within an only portrait iPhone app

≯℡__Kan透↙ 提交于 2019-12-04 10:55:38
问题 I've got an iPhone application with a storyboard,few xib and custom cells. The application is set as a "portrait" as "supported interface orientation" (i mean everything is display like that). In my custom cells, there is Uiwebview that is linked to a youtube embedded video, when i clicked it the video start to playing, but my problem is that they are always playing in "portrait" mode. I've read lots of things that solve this problem but only in ios5. Actually : I can identify when the video

How can I get a UIWebView's UIScrollView delegate methods called from within a standard UIViewController?

独自空忆成欢 提交于 2019-12-04 10:44:51
So I just have a standard UIViewController with a UIWebView in it that displays a pdf. For the app functionality, I have need to be able to respond to the UIWebView's nested UIScrollView events like scrollViewWillBeginDragging, scrollViewDidScroll, etc. The only way I can get access to the scrollView is to (it seems like a hack) go in and get it by the subviews array: for (id subview in webView.subviews){ if ([[subview class] isSubclassOfClass: [UIScrollView class]]) { UIScrollView * s = (UIScrollView*)subview; s.delegate = self; s.tag = 1; scrollView = s; } } But that seems to introduce more

Listen to all requests from UIWebView

点点圈 提交于 2019-12-04 10:42:51
I can intercept the initial load request from a UIWebView with: (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType. How do I log all the requests from the page I'm loading? Update: Another option is to use NSURLProtocol to hear requests the application makes, including all the ones from the web view. I will suggest a creative solution. This is not really what you want, but since that is not really possible at this point with the SDK, this is the only possible solution. @interface PrintingCache :

Cocos2d-x: possible to use HTML (UIWebView)?

痞子三分冷 提交于 2019-12-04 10:35:55
I'm trying out cocos2d-x and got to the point where I can build the Javascript samples for Android and run them inside a browser as well. Now I want to create my own game, but coming from a HTML background, I'd rather use HTML tags with CSS than use Javascript to setup the user interface. I've read about UIWebView which can display HTML-pages in an app, but I was wondering if anyone has ever done this in combination with Cocos2D-x ? And could this be transparent, to overlay a normal cocos2d-x screen in the app then? If so, how could this be done? You can use CCXWebview for that with Cocos2d-x.

playing youtube video inside uiwebview. How to handle the “done” button?

瘦欲@ 提交于 2019-12-04 10:33:27
问题 I have a uiwebview that plays a youtube video. How can I handle the done button action? Right now, when I tap the done button it changes back to my app main menu (not the menu that was supposed to dismiss to) and it just freezes. Can anyone help me please? Ps: the menu where the uiwebview is located, was previously presented modally. 回答1: The YouTube plug-in player is itself a modal view controller. It is returning to its presentingViewController when the done button is pressed. Its

Multiple UIWebView WebCore Crashes

时光怂恿深爱的人放手 提交于 2019-12-04 10:27:56
问题 I'm embedding YouTube videos using the power of the YouTube Helper Library. However, we're seeing multiple crashes in production related to WebCore and a couple related to JavaScriptCore. It might be important to note that these crashes are only happening on iOS 12 devices. See below for details of some of the crashes: 1. VideoFullscreenControllerContext::rateChanged(bool, float) Thread 0 name: Thread 0 Crashed: 0 WebCore 0x000000024227c270 VideoFullscreenControllerContext::rateChanged(bool,

Check if an URL has got http:// prefix

☆樱花仙子☆ 提交于 2019-12-04 10:11:43
问题 In my application, when the user add an object, can also add a link for this object and then the link can be opened in a webView. I tried to save a link without http:// prefix, then open it in the webView but that can't open it! Before webView starts loading, is there a method to check if the URL saved has got http:// prefix? And if it hasn't got it, how can I add the prefix to the URL? Thanks! 回答1: You can use the - (BOOL)hasPrefix:(NSString *)aString method on NSString to see if an NSString