Playwright: [Feature] Enable background page access of browser extension in Firefox

Created on 8 Jul 2020  路  5Comments  路  Source: microsoft/playwright

Let us know what functionality you'd like to see in Playwright and what is your use case.
It would be great, if we can access the background page of the browser extension as like in Chrome (https://playwright.dev/#version=v1.2.0&path=docs%2Fapi.md&q=working-with-chrome-extensions).

Do you think others might benefit from this as well?
Currently automation developers use web-sockets or other work around to enable communication between automation scripts and the browser extensions. This feature will enable many automation developers who work with browser extension to use same APIs to communicate with the background page of the extension.

P3-collecting-feedback

Most helpful comment

the a11y and performance auditing can be performed via Playwright interfaces as well.

To clarify, I am a developer of the Accessibility Insights for Web extension looking to write end to end tests of our extension; I'm not looking to use the extension to audit a different product under test.

Support for extensions and bg pages is outside of the scope of Playwright.

Playwright explicitly documents how to use it to test extensions in Chromium and even provides a specific ChromiumBrowserContext API for accessing backgroundPages. Are you saying that we should expect that functionality to go away or become deprecated? Or that it's in-scope for Chromium but not Firefox? The latter feels confusing; "Support for all browsers" is the top bullet point on Playwright's Why Playwright? page, it feels very inconsistent for there to be browser features that are in-scope for some browsers and out-of-scope for others.

Is there a way to convert those great extensions into the code that works via Playwright?

As an extension developer, coercing our extension code to run outside of the context of a browser extension is a valuable methodology for some tests (eg, unit tests), but not for the kind of tests that I would want to use a browser automation tool like Playwright for! The primary value that Playwright adds for our testing is being able to test in the context that a user will see it.

All 5 comments

We would love to use this for testing Accessibility Insights for Web!

Really useful for decentralised apps using crypto wallet software like Joule, Meta Mask and Blockstack Connect!

Support for extensions and bg pages is outside of the scope of Playwright. Is there a way to convert those great extensions into the code that works via Playwright? Playwright is more powerful than extensions in terms of accessing the page content and runtime, so all the a11y and performance auditing can be performed via Playwright interfaces as well.

the a11y and performance auditing can be performed via Playwright interfaces as well.

To clarify, I am a developer of the Accessibility Insights for Web extension looking to write end to end tests of our extension; I'm not looking to use the extension to audit a different product under test.

Support for extensions and bg pages is outside of the scope of Playwright.

Playwright explicitly documents how to use it to test extensions in Chromium and even provides a specific ChromiumBrowserContext API for accessing backgroundPages. Are you saying that we should expect that functionality to go away or become deprecated? Or that it's in-scope for Chromium but not Firefox? The latter feels confusing; "Support for all browsers" is the top bullet point on Playwright's Why Playwright? page, it feels very inconsistent for there to be browser features that are in-scope for some browsers and out-of-scope for others.

Is there a way to convert those great extensions into the code that works via Playwright?

As an extension developer, coercing our extension code to run outside of the context of a browser extension is a valuable methodology for some tests (eg, unit tests), but not for the kind of tests that I would want to use a browser automation tool like Playwright for! The primary value that Playwright adds for our testing is being able to test in the context that a user will see it.

I think extension is valuable because we can test if page doesn't break with popular extension like ublock etc. Is there way to change default from extension off to extension on from our side? And yes crypto stuff works on extension and it can be useful there too.

At least in puppeteer it used to work on ephemeral mode and well as non ephemeral mode I don't know why playwright doesn't support it :(

Was this page helpful?
0 / 5 - 0 ratings