Skip to content

[v1.59] Closed Shadow Roots unsupported #52

@regseb

Description

@regseb

Since v1.59.0, Patchright can no longer interact with elements in Closed Shadow Roots.

  • package.json

    {
      "name": "testcase",
      "version": "1.0.0",
      "type": "module",
      "dependencies": {
        "patchright": "1.59.1"
      }
    }
  • index.js

    import { chromium } from "patchright";
    
    const context = await chromium.launchPersistentContext("", {
      channel: "chrome",
      headless: false,
      viewport: null,
    });
    const page = await context.newPage();
    await page.goto("https://peet.ws/turnstile-test/managed.html");
    
    console.log(await page.locator(".cf-turnstile").getAttribute("class"));
    console.log(await page.locator('.cf-turnstile iframe').getAttribute("id"));
    
    await page.close();
    await context.close();
  1. npm install

  2. node index.js

    cf-turnstile
    node:internal/modules/run_main:107
        triggerUncaughtException(
        ^
    
    locator.getAttribute: Timeout 30000ms exceeded.
    Call log:
      - waiting for locator('.cf-turnstile iframe')
    
        at /home/testcase/index.js:12:56 {
      name: 'TimeoutError'
    }
    
    Node.js v24.14.1
    

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions