Skip to content

fix: isolate headless Chrome profiles on macOS - #322

Open
hesong12 wants to merge 1 commit into
iOfficeAI:mainfrom
hesong12:fix/macos-chrome-keychain
Open

fix: isolate headless Chrome profiles on macOS#322
hesong12 wants to merge 1 commit into
iOfficeAI:mainfrom
hesong12:fix/macos-chrome-keychain

Conversation

@hesong12

Copy link
Copy Markdown

Summary

Every direct Chromium rendering path now launches with a unique temporary --user-data-dir; macOS additionally receives --use-mock-keychain.

This prevents headless document rendering from contending with the user's Chrome profile or attempting to create Chrome Safe Storage in the user login keychain, which can display a system Keychain reset prompt when HOME is isolated.

Coverage

The shared isolation helper is used by DOM dumping, regular screenshots, sized screenshots, and clipped screenshots. Temporary profiles are removed after the browser exits.

Validation

dotnet is not installed on the submitting macOS machine, so this needs the repository's .NET CI build.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6b3123dd6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +437 to +438
try { Directory.Delete(Path, recursive: true); }
catch { /* temporary profile cleanup is best effort */ }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Wait for timed-out Chrome processes before deleting profiles

When a Chrome invocation times out on Windows, both RunBinary and RunChromeCapture call Kill(true) and return without waiting for the process tree to exit. Dispose therefore immediately attempts this deletion while Chrome can still hold profile files open; the exception is swallowed and the unique officecli-chrome-* directory is permanently left behind, potentially leaking substantial temporary data after repeated render timeouts. Wait for termination or retry cleanup before abandoning the directory.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant