Skip to content

[Bug]: launchPersistentContext opens about:blank, not existing Chrome profile #35836

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
juanjopc opened this issue May 2, 2025 · 5 comments
Closed

Comments

@juanjopc
Copy link

juanjopc commented May 2, 2025

Version

1.52.0

Steps to reproduce

Steps to Reproduce

  1. Save code below as test.js.
  2. Ensure the paths for User Data Dir, executablePath, and the Profile Name inside the script are correct for your system.
  3. Close related Chrome instances (check Task Manager).
  4. Run node test.js.
  5. Observe Chrome opens about:blank.
// Ultra-brief script for issue: launchPersistentContext (direct paths)
const { chromium } = require('playwright');

(async () => {
  console.log('Attempting to launch profile with direct paths...');
  try {
    const context = await chromium.launchPersistentContext(
      // --- ENSURE THIS PATH IS CORRECT ---
      'C:\\Users\\Windows 10\\AppData\\Local\\Google\\Chrome\\User Data', // User Data Dir
      {
        headless: false,
        // --- ENSURE THIS PATH IS CORRECT ---
        executablePath: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', // Chrome Path
        // --- ENSURE THIS PROFILE FOLDER EXISTS within User Data Dir ---
        args: ['--profile-directory=Profile 13'] // Profile Name
      }
    );

    console.log('Context launched. Verifying page...');
    const page = context.pages()[0] || await context.newPage();
    await page.goto('https://example.com'); // Simple navigation test

    console.log(`Navigated to ${page.url()}. Browser will remain open.`);
    await new Promise(() => {}); // Keep script alive

  } catch (error) {
    console.error(`\n--- ERROR ---`);
    console.error(error.message);
    process.exit(1);
  }
})();

Expected behavior

A Chrome window should open using my Profile 13, showing its usual start page or state, and then navigate to https://example.com.

Actual behavior

A Chrome window opens showing only an about:blank page. The script then navigates this blank page to https://example.com, but the original profile state (extensions, cookies, etc.) is missing.

Additional context

This issue happens with any Chrome profile.

Image
Image

Environment

System:
    OS: Windows 10 / Windows 11 (VM)
Binaries:
    Node: 22.13.0
    npm: 10.9.2
Browsers:
    Chrome: Version 136.0.7103.48 (Official Build) (64-bit)
npmPackages:
    playwright: 1.52.0
@MrQazi
Copy link

MrQazi commented May 2, 2025

launchPersistentContext never ends

I think this is not playwright issue
just tested it

happening with selenium as well
also in python impl

@juanjopc
Copy link
Author

juanjopc commented May 3, 2025

I think it's due to the Chromium 136 update.

@MrQazi
Copy link

MrQazi commented May 4, 2025

Edge is working
IDK about Firefox

@mxschmitt
Copy link
Member

This is caused by a recent Chrome change: https://developer.chrome.com/blog/remote-debugging-port

As a workaround you can pass args: ['--disable-features=DevToolsDebuggingRestrictions'] to launchPersistentContext.

What is your scenario?

@juanjopc
Copy link
Author

Thanks @mxschmitt, this works for me:

args: [
  '--profile-directory=Profile 13',
  '--disable-features=DevToolsDebuggingRestrictions'
]

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

No branches or pull requests

3 participants