Skip to content

Command "chrome.exe --headless --user-data-dir=${USER_DATA_DIR}" does NOT work if USER_DATA_DIR comes as or with any parent as directory junction #1633

@NotAndOr

Description

@NotAndOr

Describe the bug
Command "chrome.exe --headless --user-data-dir=${USER_DATA_DIR}" does NOT work if USER_DATA_DIR comes as or with any parent as directory junction, which may fail Microsoft Edge DevTools.

To Reproduce
Steps to reproduce the behavior:

  1. Enable portable mode of VS Code by create folder "data" as directory junction rather than real folder.
  2. Open a folder with html file inside, for example a local copy of folder "demo-to-do" from Microsoft Edge Demos.
  3. Try to start Edge DevTools by right-clicking an HTML file, for example file index.html in folder "demo-to-do".
    Snipaste_2023-04-01_16-08-43
  4. See what pop up are NOT Edge DevTools tab and Edge DevTools: Browser tab,
    Edge DevTools tab and Edge DevTools: Browser tab
    BUT error dialog box.
    Snipaste_2023-04-01_16-09-26

Log File
Not available.

VS Code Version: 1.76.2

Additional context

  1. Generating launch.json and invoking "Launch Edge Headless and attach DevTools" results in same error.
  2. Invoking "Launching Edge and attach DevTools" workarounds this error.
  3. It is reasonable to conclude that argument --headless do matters.
  4. Switching to "pwa-chrome" in launch.json results in same as "pwa-msedge".
  5. USER_DATA_DIR with directory junction fails command "chrome.exe --headless --user-data-dir=${USER_DATA_DIR}".
  6. USER_DATA_DIR with directory junction does NOT fail command "chrome.exe --user-data-dir=${USER_DATA_DIR}".
  7. USER_DATA_DIR with directory junction does NOT fail command "chrome.exe --headless --no-sandbox --user-data-dir=${USER_DATA_DIR}".
  8. It is reasonable to speculate that there is some conflict among feature Headless and feature Sandbox and option USER_DATA_DIR with directory junction in Chromium and derived Edge and Chrome.
  9. I have tried to use fs.realpathSync() to purify resolvedDataDir in launchBrowser() in src/targets/browser/browserLauncher.ts, and prevented Edge DevTools from reproducing that unexpected behavior on OS Windows.
  10. Let me know if there is some introduced impact not taken into my account, for example some unanticipated side effect on OS other than Windows.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions