You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Question] Testing an extension's content-script #1083
I have an extension that I would like to test using playwright. I'm currently able to load up my extension on Chromium as shown in the examples, but that's about all I can do at this point.
Creating a new page defaults to creating it in incognito mode, regardless of whether a BrowserContext is created or not. By default, extensions are disabled in incognito mode.. ergo my extension cannot be tested.
I think you missed my point. An incognito context has no extensions enabled. Even if I don't want to test my content script code, I can't even test for it's effects since it'll never run in an incognito context without me allowing my extension to run in incognito mode.
Is there a way to do that programmatically? If not, then you can't test extensions using playwright 😕
Pavel Feldman (@pavelfeldman) chromium.launchPersistent works fine, but this function returns BrowserContext object, not Browser. It is causing issue which you have no access to Browser object to make some operation on background tab. Thoughts? Do you have some idea how to hande it?
Activity
k15a commentedon Feb 24, 2020
Looks like this is not working yet: https://github.com/microsoft/playwright/blob/v0.11.1/docs/api.md#working-with-chrome-extensions last sentence.
gurupras commentedon Feb 24, 2020
I think you missed my point. An incognito context has no extensions enabled. Even if I don't want to test my content script code, I can't even test for it's effects since it'll never run in an incognito context without me allowing my extension to run in incognito mode.
Is there a way to do that programmatically? If not, then you can't test extensions using playwright 😕
k15a commentedon Feb 25, 2020
I found a way to do that programmatically:
pavelfeldman commentedon Feb 27, 2020
You should use
chromium.launchPersistentto access default profile and test extension content scripts.Also, you can pierce shadow dom via:
await page.click('css=body > extensions-manager >> css=#items-list >> css=extensions-item >> css=#detailsButton');(we'll get rid of those css= over time)
12masta commentedon Jun 19, 2020
Pavel Feldman (@pavelfeldman) chromium.launchPersistent works fine, but this function returns BrowserContext object, not Browser. It is causing issue which you have no access to Browser object to make some operation on background tab. Thoughts? Do you have some idea how to hande it?
chore: update to Docusaurus v3 (microsoft#1083)
fix(mcp): filter Sapoto-bridge hidden CDP targets from browser_tabs l…
T1: Gut init script — remove Red-tier stealth patches (#7)