Skip to content

Commit

Permalink
allow 'about:srcdoc' URL in iOS WKWebView for iframe's srcdoc attribu…
Browse files Browse the repository at this point in the history
…te (gree#988)

Co-authored-by: haruto.otake <[email protected]>
  • Loading branch information
trapezoid and haruto.otake authored Oct 12, 2023
1 parent daa1a46 commit 1276cc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/package/Assets/Plugins/iOS/WebView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ - (void)webView:(WKWebView *)wkWebView decidePolicyForNavigationAction:(WKNaviga
decisionHandler(WKNavigationActionPolicyCancel);
return;
} else if (![url hasPrefix:@"about:blank"] // for loadHTML(), cf. #365
&& ![url hasPrefix:@"about:srcdoc"] // for iframe srcdoc attribute
&& ![url hasPrefix:@"file:"]
&& ![url hasPrefix:@"http:"]
&& ![url hasPrefix:@"https:"]) {
Expand Down
1 change: 1 addition & 0 deletions plugins/iOS/WebView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ - (void)webView:(WKWebView *)wkWebView decidePolicyForNavigationAction:(WKNaviga
decisionHandler(WKNavigationActionPolicyCancel);
return;
} else if (![url hasPrefix:@"about:blank"] // for loadHTML(), cf. #365
&& ![url hasPrefix:@"about:srcdoc"] // for iframe srcdoc attribute
&& ![url hasPrefix:@"file:"]
&& ![url hasPrefix:@"http:"]
&& ![url hasPrefix:@"https:"]) {
Expand Down

0 comments on commit 1276cc6

Please sign in to comment.