Comments (7)
Interesting. I was able to recreate this on your URL as well as others. I will work on this one.
I am open to solution suggestions from others as well.
from kinwebbrowser.
I submitted this issue to StackOverflow here:
https://stackoverflow.com/questions/26501172/launching-phone-email-map-links-in-wkwebview
from kinwebbrowser.
I was able to get it to work for the Google Maps link (which appears to be related to the target="_blank") and for the tel: scheme by adding this function to your KINWebBrowserViewController.m
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
{
if(webView != self.wkWebView) {
decisionHandler(WKNavigationActionPolicyAllow);
return;
}
UIApplication *app = [UIApplication sharedApplication];
NSURL *url = navigationAction.request.URL;
if (!navigationAction.targetFrame) {
if ([app canOpenURL:url]) {
[app openURL:url];
decisionHandler(WKNavigationActionPolicyCancel);
return;
}
}
if ([url.scheme isEqualToString:@"tel"])
{
if ([app canOpenURL:url])
{
[app openURL:url];
decisionHandler(WKNavigationActionPolicyCancel);
return;
}
}
decisionHandler(WKNavigationActionPolicyAllow);
}
from kinwebbrowser.
I appreciate your solution. You are definitely on the right path. After some pretty extensive research on this issue, I discovered that the code above introduces a serious security flaw.
The way you are calling [app openURL:url];
enables the application to automatically open any other apps without prompting the user. This could cause the user to be tricked into placing a call or even a FaceTime call. This has serious security concerns, as users could be charged for these calls or have image of their face stolen.
See more information here: http://algorithm.dk/posts/rtfm-0day-in-ios-apps-g-gmail-fb-messenger-etc
I am actively working on a solution for this and will update soon.
from kinwebbrowser.
Awesome catch! Glad you found that one (and are working on a solution!) Let me know if there's anything I can do to help.
For the moment, our use-case is only displaying internal documents that we have full control over, so it's not a real security issue for us. But, in the near future, that my be extended and it may very well become an issue.
from kinwebbrowser.
I just pushed these changes onto: https://github.com/dfmuir/KINWebBrowser/tree/external_url_support
It enables both of the links on your page that were previously broken.
Let me know what you think. Basically, if the scheme of the URL is not http or https, and [[UIApplication sharedApplication] canOpenURL:URL]; then the user is prompted to open an external app.
Two weaknesses right now:
- When launching your Google Maps HTTP link, the website opens successfully, but the app is not launched. This doesn't seem ideal.
- There does not seem to be a way to determine which app will be opening the URL, so there is no way to present that information to the user when making the decision about the external app.
I am going to think a little bit more on this before merging with master.
from kinwebbrowser.
I believe this issue has been resolved in KINWebBrowser 1.2.0
from kinwebbrowser.
Related Issues (20)
- How to hide browser navigation bar?
- Rename customActivityItems
- Conditionally open SafariViewController on iOS 9+ devices
- use cocoapods install version error HOT 4
- no internet connection
- UIAlertController warning HOT 2
- Write it with swift HOT 1
- how to change "Done" bar button Item from right to left?
- Subclassing issues HOT 2
- Send Email function inside KINWebBrowser not running
- Several deprecations - support for iOS 9 and 10?
- Fatal Exception: NSRangeException at KINWebBrowserViewController.m#L376 HOT 1
- Carthage support
- How to change background color of KINWebBrowser HOT 1
- Received error called "The URL canβt be shown"
- how to use with custom navigation bar
- Unbalanced call when try to upload from 'More..' Icloud Drive
- Sometimes it Automatically executes open in App option
- ITMS-90809: UIWebView API Deprecation
- App Crash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kinwebbrowser.