WKWebView


Gerriet M. Denkmann
 

On 5 Oct 2017, at 18:38, Alex Zavatone <zav@...> wrote:

WKPrivateNavigationDelegate webView:decidePolicyForNavigationAction?

On Oct 5, 2017, at 6:32 AM, Gerriet M. Denkmann <g@...> wrote:

The documentation says:
“In apps that run in macOS 10 and later, use the WKWebView class instead of using WebView.”
“In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView.”

WebView has:
webView:decidePolicyForNavigationAction:decisionHandler:

and UIWebView has:
webView:shouldStartLoadWithRequest:navigationType:

what would the equivalent in WKWebView be?

WKNavigationDelegate has:
webView:decidePolicyForNavigationAction:decisionHandler:
Correction:
this is only called once (after loadHTMLString:baseURL:) with navigationType = WKNavigationTypeOther;
and also when clicking on a link with scheme ≠ file with navigationType = WKNavigationTypeLinkActivated.

By the way, this is still macOS 12 (because the installer for macOS 13 does not work).

Gerriet.


Gerriet M. Denkmann
 

On 5 Oct 2017, at 18:38, Alex Zavatone <zav@...> wrote:

WKPrivateNavigationDelegate webView:decidePolicyForNavigationAction?
Called once; never called when I click on a link.


On Oct 5, 2017, at 6:32 AM, Gerriet M. Denkmann <g@...> wrote:

The documentation says:
“In apps that run in macOS 10 and later, use the WKWebView class instead of using WebView.”
“In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView.”

WebView has:
webView:decidePolicyForNavigationAction:decisionHandler:

and UIWebView has:
webView:shouldStartLoadWithRequest:navigationType:

what would the equivalent in WKWebView be?

WKNavigationDelegate has:
webView:decidePolicyForNavigationAction:decisionHandler:

but this is only called once (after loadHTMLString:baseURL:) with navigationType = WKNavigationTypeOther;
never when I click on a link.

Gerriet.





Alex Zavatone
 

WKPrivateNavigationDelegate webView:decidePolicyForNavigationAction?

On Oct 5, 2017, at 6:32 AM, Gerriet M. Denkmann <g@...> wrote:

The documentation says:
“In apps that run in macOS 10 and later, use the WKWebView class instead of using WebView.”
“In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView.”

WebView has:
webView:decidePolicyForNavigationAction:decisionHandler:

and UIWebView has:
webView:shouldStartLoadWithRequest:navigationType:

what would the equivalent in WKWebView be?

WKNavigationDelegate has:
webView:decidePolicyForNavigationAction:decisionHandler:

but this is only called once (after loadHTMLString:baseURL:) with navigationType = WKNavigationTypeOther;
never when I click on a link.

Gerriet.




Gerriet M. Denkmann
 

The documentation says:
“In apps that run in macOS 10 and later, use the WKWebView class instead of using WebView.”
“In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView.”

WebView has:
webView:decidePolicyForNavigationAction:decisionHandler:

and UIWebView has:
webView:shouldStartLoadWithRequest:navigationType:

what would the equivalent in WKWebView be?

WKNavigationDelegate has:
webView:decidePolicyForNavigationAction:decisionHandler:

but this is only called once (after loadHTMLString:baseURL:) with navigationType = WKNavigationTypeOther;
never when I click on a link.

Gerriet.