MixinNetwork / MixinNetwork/flutter-plugins
[desktop_webview_window] Can't open URL about:srcdoc on macOS
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 512
- Forks
- 292
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 7
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the macOS WebViewLayoutController.swift WKNavigationDelegate method shown in the issue and inspect how navigation URL schemes are filtered. Reproduce the about:srcdoc navigation on macOS, then verify that the intended URL opens without breaking the existing http, https, and file handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flutter, swift
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100