Skip to content

[Bug]: Playwright crashes WebWorker in a Chromium/FireFox "extension" #38638

@44xtc44

Description

@44xtc44

Version

1.57.0

Steps to reproduce

  1. clone repository https://github.com/44xtc44/BUG-Playwright-fail-WebWorker-Extension
  2. sudo su # remember your current user_name
    npm install -g n # to be able to downgrade the node version
    n 20 # to install the current max node.js version for playwright
    su user_name # back to last user env
    node -v # check version
  3. npm install # see at least no warnings for playwright
  4. Load the extension into Chromium to see it running properly. WebWorker sends a message.
  5. Extension App, what we do:
    Have a web application extension/add-on with a few web workers that performs any actions.
    Configure "postMessage", "onmessage", "onerror".
    The WebWorker instance don't receive a message, only an empty error object.
  6. Extension manifest.json Version 3
    Since Browser brands use different manifest syntax, copy from /tests/manifest/.
    Play around with the config. Perhaps this helps.
  7. Test only one Browser brand with an extension!!! Needs the correct manifest.json file.
    import { chromium } from "playwright"; or import { chromium } from "playwright/test";
    or also tested:
    import { firefox } from "playwright"; or import { firefox } from "playwright/test";
  8. run the function from test file in terminial /tests/end2end/

    npx run-func chromium.js homePageOpen -y

  9. Please test the worker also with an imported module! If you got it working.

Expected behavior

I would expect to see a web worker message.

Actual behavior

I can not see a web worker message. Only an empty error object.

Additional context

Playwright FireFox (Nightly) test run shows the same error as Chromium.

To exclude the started Browser instance from failure start
firefox module via test module and keep the browser instance open.
Use the manifest from /tests/manifest/firefox.

"about:debugging" add temporary Add-on, locate -> bug report repo root folder manifest.json. Fire.
Browser instance works fine, WebWorker instance responds accordingly.

Environment

Playwright Version: 1.57.0
Operating System: Linux Mint 22.1, Cinnamon 64-bit
Node version: v20.19.6; only ES modules used
Browser: Chromium, FireFox
manifest.json Version: 3
System:
Linux: 6.8.0-58-generic
Memory: 32.00 GB

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