fix(native-host): register a .cmd host that Smart App Control allows - #43
Merged
Merged
Conversation
The installer compiled native-host/launcher.cs into an unsigned exe, and Smart App Control blocked it on every reconnect, so unattended capture could never reach the extension. Register a two-line ASCII .cmd that runs the signed node.exe instead, and remove the old exe on reinstall. The note that Chromium is unreliable with .cmd hosts dates from a .cmd registered through a BOM-prefixed manifest, which Chromium rejects on its own; the manifest is BOM-free now. The installer also refuses to report success when its shell runs inside a packaged app's container (the Claude desktop app), where the files and HKCU keys land in a private copy a normally started browser never sees. Adds a regression check that the host exits and frees the pipe when the browser's stdin ends, the orphan guard the launcher used to duplicate. Fixes #8 Co-Authored-By: Claude Opus 5.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.
Fixes #8.
Cause:
scripts/install-native-host.ps1compilednative-host/launcher.csinto an unsigned exe. Smart App Control blocks unsigned binaries and has no per-file allowlist, so Code Integrity logged 3033/3077 every 30 s (the extension's reconnect alarm) and the bridge never connected.Fix:
.cmdthat runs the signednode.exe(OpenJS Foundation). The installer removes the old exe andnode-path.txt.launcher.csis deleted.%LOCALAPPDATA%and HKCU go to%LOCALAPPDATA%\Packages\<app>\LocalCache\..., which a normally started browser never sees. Before this change it printed success anyway.test/native-host.test.mjsconfirms the host exits and frees the pipe when the browser's stdin ends. That is now the only orphan guard.Verified:
npm test, lint, and format pass.--pinganswered by extension v1.6.5, and Code Integrity logged no blocks after the switch.🤖 Generated with Claude Code