flutter-plugins
flutter-plugins copied to clipboard
[desktop_webview_window] Can't open URL about:srcdoc on macOS
Can't open URL about:srcdoc on macOS... Is there any reason why the URL "about" is not on the scheme guard block? Thank you.
On WebViewLayoutController.swift:
extension WebViewLayoutController: WKNavigationDelegate {
func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
guard let url = navigationAction.request.url else {
decisionHandler(.cancel)
return
}
guard ["http", "https", "file"].contains(url.scheme?.lowercased() ?? "") else {
decisionHandler(.cancel)
return
}
methodChannel.invokeMethod("onUrlRequested", arguments: [
"id": viewId,
"url": url.absoluteString,
] as [String: Any])
decisionHandler(.allow)
}
Version:
- Flutter Version: v3.24.0
- OS: macOS
- plugin: desktop_webview_window: 0.2.3