From 7dc29355b42da42a21813cf6bc3a0c1d966ecbad Mon Sep 17 00:00:00 2001 From: Iguchi Tomokatsu Date: Tue, 18 Dec 2018 16:24:24 +0900 Subject: [PATCH] [fix] encode resourceURL --- ios/Classes/InAppBrowserWebViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/Classes/InAppBrowserWebViewController.swift b/ios/Classes/InAppBrowserWebViewController.swift index 4c5ae31a..75e21cd2 100644 --- a/ios/Classes/InAppBrowserWebViewController.swift +++ b/ios/Classes/InAppBrowserWebViewController.swift @@ -746,7 +746,9 @@ class InAppBrowserWebViewController: UIViewController, UIScrollViewDelegate, WKU } else if message.name == "resourceLoaded" && (webViewOptions?.useOnLoadResource)! { if let resource = convertToDictionary(text: message.body as! String) { - let url = URL(string: resource["name"] as! String)! + let rawUrl = resource["name"] as! String + let encodedUrl = rawUrl.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)! + let url = URL(string: encodedUrl)! if !UIApplication.shared.canOpenURL(url) { return }