Skip to content
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

Playwright Recorder webextension for Chrome / Edge and Firefox #30347

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ruifigueira
Copy link
Contributor

@ruifigueira ruifigueira commented Apr 11, 2024

I was able to set up a basic PoC for playwright recorder as a webextension, and currently runs in Chrome, Edge and Firefox.

Instead of trying to run the whole playwright stack as a webextension, it only runs the necessary bits from recorder.ts, which already has lots of isomorphic code. For instance, alll code generation logic is almost isomorphic right now, except the usage of EventEmitter, which is the only polyfill I had to import.

In terms of webextensions APIs, I'm only using chrome APIs that are compatible with firefox, namely:

For the purpose of this PoC, I implemented lighter versions of server page, frame and browserContext with only the necessary bits, and copied the server recorder.ts to remove all the things that don't make sense for the webextension.

TLDR: most of the code needed for the recorder to work is already isomorphic or only needs some minor adjustments. Non-isomorphic code can be replaced with implementations that rely on webextension APIs.

Firefox Demo:

fT80LktCcB.mp4

Chrome Demo:

i4TKZ2VYZG.mp4

This comment has been minimized.

This comment has been minimized.

PoC of chromium extension and firefox addon

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

Test results for "tests 1"

3 flaky ⚠️ [chromium-library] › library/trace-viewer.spec.ts:240:1 › should have network requests
⚠️ [webkit-library] › library/browsercontext-clearcookies.spec.ts:72:3 › should remove cookies by name regex
⚠️ [webkit-page] › page/workers.spec.ts:243:3 › should support offline

27246 passed, 671 skipped
✔️✔️✔️

Merge workflow run.

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

Successfully merging this pull request may close these issues.

None yet

1 participant