Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Is it possible to now use Puppeteer from inside the browser?

Talking about WebDriver (BiDi) in general rather than Puppeteer specifically, it depends what exactly you mean.

Classic WebDriver is a HTTP-based protocol. WebDriver BiDi uses websockets (although other transports are a possibility for the future). Script running inside the browser can create HTTP connections and create websockets connections, so you can create a web page that implements a WebDriver or WebDriver BiDi client. But of course you need to have a browser to connect to, and that needs to be configured to actually allow connections from your host; for obvious security reasons that's not allowed by default.

This sounds a bit obscure, but it can be useful. Firefox devtools is implemented in HTML+JS in the browser (like the rest of the Firefox UI), and can connect to a different Firefox instance (e.g. for debugging mobile Firefox from desktop). The default runner for web-platform-tests drives the browser from the outside (typically) using WebDriver, but it also provides an API so the in-browser tests can access some WebDriver commands.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: