feat: Add macOS WebView debugging documentation and plugin support#7
Open
billy-and-the-oceans wants to merge 1 commit intodirvine:mainfrom
Open
Conversation
On macOS, WKWebView doesn't expose Chrome DevTools Protocol (CDP), which means execute_js and screenshot tools don't work. This commit: - Adds comprehensive documentation in README about the tauri-plugin-native-webview solution for macOS WebView debugging - Updates error messages in debug.rs to guide users to the plugin when CDP fails - Adds docstring hints in window.rs about using the plugin for hidden screenshots - Adds suggest_native_plugin() helper for future auto-detection The plugin provides: - Native WKWebView screenshots (works when window is hidden) - JS evaluation with return values via IPC - Debug info via Tauri APIs Users can use call_ipc_command with plugin commands: - plugin:native-webview|snapshot - plugin:native-webview|eval_js - plugin:native-webview|debug_info Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds documentation and code hints to help macOS users with WebView debugging, since WKWebView doesn't expose Chrome DevTools Protocol (CDP).
Problem
On macOS:
execute_jsandtake_screenshotfail because no CDP port is foundSolution
We created
tauri-plugin-native-webviewwhich provides IPC commands that work around this limitation:plugin:native-webview|snapshotplugin:native-webview|eval_jsplugin:native-webview|debug_infoChanges
README.md: Added comprehensive "macOS WebView Debugging" section with:
call_ipc_commandsrc/tools/debug.rs:
find_debug_porterror message to guide users to plugin on macOSsuggest_native_plugin()helper for future auto-detectionsrc/tools/window.rs:
Plugin Repository
The plugin source is at: https://github.com/fuwa-cloud/tauri-plugin-native-webview
(Will be published to crates.io)
Testing
Test plan
🤖 Generated with Claude Code