mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Merge pull request #851 from mihaip/fix-target-blank-links
Fix tapping on target=_blank links not working in the original story view
This commit is contained in:
commit
44de300579
1 changed files with 19 additions and 5 deletions
|
@ -287,10 +287,10 @@
|
|||
[webView reload];
|
||||
}
|
||||
|
||||
# pragma mark: -
|
||||
# pragma mark: UIWebViewDelegate protocol
|
||||
# pragma mark -
|
||||
# pragma mark WKNavigationDelegate protocol
|
||||
|
||||
- (void)webView:(UIWebView *)aWebView didCommitNavigation:(null_unspecified WKNavigation *)navigation {
|
||||
- (void)webView:(WKWebView *)aWebView didCommitNavigation:(null_unspecified WKNavigation *)navigation {
|
||||
if ([webView canGoBack]) {
|
||||
[backBarButton setEnabled:YES];
|
||||
} else {
|
||||
|
@ -310,7 +310,7 @@
|
|||
finishedLoading = YES;
|
||||
}
|
||||
|
||||
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
|
||||
- (void)webView:(WKWebView *)webView didFailLoadWithError:(NSError *)error
|
||||
{
|
||||
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
|
||||
|
||||
|
@ -323,7 +323,21 @@
|
|||
finishedLoading = YES;
|
||||
}
|
||||
|
||||
- (void)updateTitle:(UIWebView*)aWebView
|
||||
# pragma mark -
|
||||
# pragma mark WKUIDelegate protocol
|
||||
|
||||
- (nullable WKWebView *)webView:(WKWebView *)aWebView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures {
|
||||
if (!navigationAction.targetFrame.isMainFrame) {
|
||||
// Load target="_blank" links into the same frame.
|
||||
[webView loadRequest:navigationAction.request];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
# pragma mark -
|
||||
|
||||
- (void)updateTitle:(WKWebView*)aWebView
|
||||
{
|
||||
NSString *pageTitleValue = webView.title;
|
||||
titleView.text = [pageTitleValue stringByDecodingHTMLEntities];
|
||||
|
|
Loading…
Add table
Reference in a new issue