Remote access on android
See original GitHub issueI am trying to use puppeteer remotely on some Android device.
I am forwarding port 9222 with $ adb forward tcp:9222 localabstract:chrome_devtools_remote
I am able to connect to the browser with
const browser = await puppeteer.connect({ browserWSEndpoint: 'ws://127.0.0.1:9222/devtools/browser', });
But when trying to get the available pages with const pages = await browser.pages();
or create a new one with const page = await browser.newPage();
, the script stalls, and the promise is never resolved.
I notice something weird when I try to list the browser targets with console.log(browser.targets())
: each loaded page appears twice in the list. For example, if the remote browser has one tab with google.com, I will see two page targets with the following TargetInfo:
{ targetId: 'ECB167EEA4CEBC8DCCF2A8C9D14E4207', type: 'page', title: 'Google', url: 'https://www.google.com/', attached: false, browserContextId: '5E3E44DA3AE8CB75491B17CBD5BC5D80' }
{ targetId: '2968', type: 'page', title: 'Google', url: 'https://www.google.com/', attached: false }
I am on macosx, and installed puppeteer with nmp install puppeteer. Node version is v12.10.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8
Top GitHub Comments
Same issue here, the
newPage()
promise is never resolved.@arenevier @SirPepe did you find any workaround?
Please try with the latest Puppeteer version and please re-open the issue if it still happens. There have been target management improvements landed in Puppeteer recently that should help with this issue.