Skip to content

Bug: 'acquireContextId failed' on certain pages #100

Closed

Description

@gustavfridell

Hi,

When using the patches with Puppeteer (both 24.8.1), this page https://www.gbl.com/en consistently gets the following error. I have the same issue both on Mac and Linux.

error: [rebrowser-patches] acquireContextId failed (tryAgain = true, tryCount = 3), errorMessage: N/A
      at acquireContextId (/[path]/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/ExecutionContext.js:496:27)

491 |             await this.#client.send('Runtime.disable');
492 |             this.#client.off('Runtime.executionContextCreated', executionContextCreatedHandler);
493 |         }
494 |         if (!contextId) {
495 |             if (!tryAgain || tryCount >= 3) {
496 |                 throw new Error(`[rebrowser-patches] acquireContextId failed (tryAgain = ${tryAgain}, tryCount = ${tryCount}), errorMessage: ${errorMessage}`);

Activity

  1. rebrowsernet commented on Oct 18, 2026

    @rebrowsernet
    Collaborator

    Root cause found. gbl.com/en (and yara.com from #116) reassign the global self, and the patch's context handshake called self[...], so it never received the context id. This affects both Puppeteer and Playwright. With #132 the patch finds the context without running anything in the page, so page globals can't break it (the fallback handshake uses window, which pages can't redefine). There's a regression test for it. Both sites work with it. Ships in the next release.

  2. rebrowsernet commented on Oct 18, 2026

    @rebrowsernet
    Collaborator

    Released in v1.1.1: rebrowser-puppeteer-core / rebrowser-puppeteer 25.14.100, rebrowser-playwright-core / rebrowser-playwright 1.64.100, and rebrowser-playwright 1.64.100 on PyPI. (npm doesn't allow re-publishing 25.14.0 / 1.64.1, so this fix release uses .100.) gbl.com and yara.com work now: the patch finds the page's context without running anything in the page. Closing.

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

Metadata

Metadata

Assignees

No one assigned

    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