pub fn guard_process_start() -> Result<GuardReport, DevToolsError>Expand description
Process-start guard. Call it first in main (before Tauri builds anything) to fail before any
webview exists; the shell plugin also runs it when it is constructed and refuses to set up when
it failed. Idempotent: the first result is returned on every call.
- Refuses a launch argument that enables remote debugging or auto-opens DevTools.
- Removes the WebView2 override environment variables from this process, so they cannot reach the browser process that WebView2 starts later (Windows).
- Refuses to continue when the WebView2
AdditionalBrowserArgumentspolicy (HKLM, HKCU, WOW6432Node) injects a debugging switch. WebView2 appends policy arguments to whatever the application passes, so the application cannot override them (Windows). - Refuses to continue when the WebView2
BrowserExecutableFolderpolicy, or the environment variable of the same purpose, makes WebView2 start a browser from another folder for this program (Windows). - Records the folders the
UserDataFolderpolicy and the WebView2 user-data environment variable name, so the port-file tripwire looks there too (Windows).
A build compiled with the dev-inspect feature does none of this: it prints one loud stderr
line saying developer inspection is active and returns an empty report.