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
I've recently been looking in to testing WebExtensions (e.g #2486). With the action.openPopup API, it's possible to trigger the extension popup by running code from the background page. This causes a new context to load which it would be useful to be able to automate.
Using the following, it actually is possible to get a reference to the new target:
Of course, this does make sense and the best solution would be accommodating extension testing in the Chrome Dev Tools protocol by returning a new "popup" type. At least one relevant issue is likely this one: https://crbug.com/1223710
In the meantime, however, removing the _isPageTargetCallback check does give you a page which can be automated! It sounds like some features are missing - #1215 (comment) - so exposing this should likely not be the default. That said, in my short amount of testing it seems to work well enough that allowing developers a way of experimenting with this functionality without needing to entirely fork Puppeteer may be desirable.
The text was updated successfully, but these errors were encountered:
I've recently been looking in to testing WebExtensions (e.g #2486). With the action.openPopup API, it's possible to trigger the extension popup by running code from the background page. This causes a new context to load which it would be useful to be able to automate.
Using the following, it actually is possible to get a reference to the new target:
However, calling
target.page()
returnsnull
because the type isother
:puppeteer/packages/puppeteer-core/src/common/Browser.ts
Lines 217 to 227 in 1bbecb3
Of course, this does make sense and the best solution would be accommodating extension testing in the Chrome Dev Tools protocol by returning a new "popup" type. At least one relevant issue is likely this one: https://crbug.com/1223710
In the meantime, however, removing the
_isPageTargetCallback
check does give you a page which can be automated! It sounds like some features are missing - #1215 (comment) - so exposing this should likely not be the default. That said, in my short amount of testing it seems to work well enough that allowing developers a way of experimenting with this functionality without needing to entirely fork Puppeteer may be desirable.The text was updated successfully, but these errors were encountered: