@@ -2,6 +2,8 @@
2#import <Foundation/Foundation.h>
2#import <Foundation/Foundation.h>
3#import <WebKit/WebKit.h>
3#import <WebKit/WebKit.h>
5+BOOL openApp(NSURL * url);
5extern void jsaddleStart(HsStablePtr);
7extern void jsaddleStart(HsStablePtr);
6extern void jsaddleResult(HsStablePtr, const char * _Nonnull result);
8extern void jsaddleResult(HsStablePtr, const char * _Nonnull result);
@@ -37,6 +39,20 @@ extern void jsaddleResult(HsStablePtr, const char * _Nonnull result);
37 jsaddleResult(self.resultHandler, [s UTF8String]);
39 jsaddleResult(self.resultHandler, [s UTF8String]);
42+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
44+ NSURL *url = navigationAction.request.URL;
46+ if(!navigationAction.targetFrame && ![url.scheme isEqualToString:@"file"]) {
48+ decisionHandler(WKNavigationActionPolicyCancel);
50+ decisionHandler(WKNavigationActionPolicyAllow);
53+ decisionHandler(WKNavigationActionPolicyAllow);
42void addJSaddleHandler(WKWebView *webView, HsStablePtr startHandler, HsStablePtr resultHandler) {
58void addJSaddleHandler(WKWebView *webView, HsStablePtr startHandler, HsStablePtr resultHandler) {