Why Webview prevent showing a webpage when click a swf? - cocoa

Now I show a swf from web in my webview , but when I click the url address in the swf to show another page with my default web browser, I found the webveiw prevent to do it , Why ? How to allow it ?Thank you very much!

You should look at the WebUIDelegate protocol, specifically this delegate method:
- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request;
If you've got an object registered as the WebView's UI delegate then this method is called when the Flash plug-in sends a URL change request. You can then do what you want with the request. By default, the WebView just ignores it.

Related

Xamarin Android - Load url in second webview

Hi I wanted to load up a webview on android. And when a link is clicked in this webview to override the loading and have the link load in another webview. So I can display the first webview without having to reload the page.
You could do the following:
set a custom webview client on your webview
webView.SetWebViewClient(new MyWebviewClient(this));
In your webview client override ShouldInterceptRequest
In ShouldInterceptRequest method use the url parameter to create/show a new webview and then just return the current displayed data to prevent loading a new webview.

How to know when WebView has refreshed due to JavaScript?

My webView has an HTML page with JavaScript that changes the appearance of the page when button is pressed in the HTML page. I can have the hosting program receive a callback through JavaScript when the button is pressed, and I can change values on the web page side of things. However, when these callbacks are made, the appearance change of the page has not yet changed:
WebViw is loaded and frameLoadDelegate is called
??? WebView is rendered and displayed
Customer clicks on the button, JavaScript `onClick' calls a JavaScript function which makes appearance changes, and then calls my Objective-C function.
Objective-C function checks appearance of WebView
??? WebView is rendered and displayed
In Apple's WebKit framwork, a WebView that has finished loading its resources sends a webView:didFinishLoadForFrame: message to its frameLoadDelegate. However, this only means that resources have been loaded, not that rendering is done… How can I detect that the WebView rendering is done? Among all the delegates of WebView, I couldn't find one that has the method I would need…

Delphi Chromium - how get data of Ajax call when a button/link is clicked

I'm using Delphi Chromium component in an application to show web pages from a Web Application.
In these pages I have buttons that fire selective Ajax calls to Web Server.
I need the following thing:
when one of these buttons is clicked, after notification of event to 'host application' I should want from this notification to get data of Ajax request (and response too, if possible...) to do some processing on them from 'host application'.
Is it possible ?
The extension (the TCefv8HandlerOwn class) is in fact just a JavaScript function which fires the TCefv8HandlerOwn.Execute (where you can get or set its parameters) when it's called from somewhere in the script.

Detect when users click on links in custom WebKit window

In my OSX/Cocoa application, I'd like to detect when users are clicking on a link in my WebKit (WebView) view. I tried setting the UI delegate and implementing "webView:createWebViewWithRequest" however, the request object is ALWAYS nil when this method is called.
The link used is valid. When used with an external web browser it will lead to a valid page.
You want to make a WebPolicyDelegate and implement the decidePolicyForNavigationAction and decidePolicyForNewWindowAction methods.

Invoke modal view controller from UIWebView weblink

Hey folks I was wondering if anyone can tip me on a painless way of invoking a modal view controller from a web link in a UIWebView. Is it possible to do this?
I want the modal view controller to still be a part of the app as opposed to closing the main app and using a helper application instead.
Any help would be greatly appreciated.
The best way to do this is by intercepting certain URLs in the UIWebView's delegate function
– webView:shouldStartLoadWithRequest:navigationType:
This can be called from javascript by setting the window's location:
window.location = "mycomprotocall:showMoadViewController";
Parse this in the delegate function, then execute any native code you like.
If you're using vanilla webpages that can be accessed from safari mobile, it is not possible. If you're programming a local webapp with phonegap or similar technologies, it is fairly easy, just catch the urls you want and handle them differently.

Resources