Questions tagged [chrome-devtools-protocol]

Questions about CDP (Chrome Devtools Protocol) that's used by many automation tools (like Puppeteer), libraries, wrappers. It's also used by Chrome's built-in devtools.

Chrome Devtools Protocol documentation: https://chromedevtools.github.io/devtools-protocol/

185 questions
12
votes
2 answers

Is there a way to trigger standard zoom (not headless)

I am running puppeteer with headless mode off in order to automate and remotely control a visible Chromium browser on another computer. Is there a way to trigger or emulate zooming on the browser just like in the UI menus or ctrl +/crtl -…
Steve H
  • 946
  • 9
  • 22
10
votes
1 answer

How to run a custom js function in playwright

How can I run a custom js function in playwright? For example show an alert. I have already tried this way but it did not work. var url = await page.evaluate(async() => { await function alert() { alert("alert"); } await alert(); });
9
votes
1 answer

DevToolsProtocol, Runtime.evaluate against worker execution context

In the console of chrome devtools there is a dropdown at the top to select the execution context. Here is an example when on www.google.com Changing the execution context changes the available global variables and what any console invoked .js can…
OrdinaryOrange
  • 2,420
  • 1
  • 16
  • 25
9
votes
2 answers

Java WebSocket message limit

I'm trying to create communication between simple Java App (using java.net.http.WebSocket class) and remote google-chrome run using google-chrome --remote-debugging-port=9222 --user-data-dir=. Sending and receiving small messages works as expected,…
8
votes
1 answer

How to use Chrome DevTools protocol in Selenium (using Python) for capturing HTTP requests and responses?

I know that Fetch Domain is used for this purpose but I do not know how exactly I can implement it. In Selenium python, I used the following code to enable issuing of requestPaused…
7
votes
2 answers

get list of events associated with a DOM elements

In Firefox it is possible to see events associated with each element in Inspect Element of developers tools. I want to have a list of elements and events associated with it, programmatically. preferably using selenium+python. I know that there is…
7
votes
1 answer

Chrome DevTools Protocol - intercepting and modifying websocket requests

I'm trying to use the Chrome DevTools Protocol (CDP) to intercept web requests and modify them. The problem is that I need to modify the headers of a WebSocket request. Is this possible? I can modify the headers of "normal" requests easily by first…
Master_T
  • 7,232
  • 11
  • 72
  • 144
6
votes
2 answers

WebView2 DevToolsProtocolEvent not raising

I'm trying to create an app that uses the WebView2 WPF component. Currently I'm working on logging the messages and errors that are written by the javascript code of the websites using console.log(). This is what I have right now: public partial…
Norberth Csorba
  • 312
  • 1
  • 9
6
votes
1 answer

Chrome DevTools Protocol Fetch Domain - getResponseBody - apparently fails with HTTP redirects

I am wishing to collect the body of an HTTP request, including when the page redirects to elsewhere. Clearly, I can use non-Fetch domain mechanisms such as Network.getResponseBody. That works fine for the "final" page in a chain of redirections, but…
5
votes
1 answer

Chrome command line flag to open devtools window undocked

I know that I can open Chrome with the devtools dock placed to the right using the flag: --auto-open-devtools-for-tabs What I would like is to be able to modify the placement of the dock from the command line. Is there any flag or configuration…
5
votes
0 answers

Chrome DevTools: What is the difference between the Network.loadingFinished and Network.dataReceived events?

I would please like to know: What is the purpose of the Network.loadingFinished event? What exactly does the documentation mean when it says, "Fired when HTTP request has finished loading?" How is this event different than the request's last…
aBlaze
  • 2,436
  • 2
  • 31
  • 63
5
votes
0 answers

Page.createIsolatedWorld grantUniveralAccess flag does not grant universal access

I'm trying to access the contentDocument of a cross origin iframe using Runtime.evaluate. As far as I understand the docs this should be possible by creating an executionContext with universal access using Page.createIsolatedWorld +…
Niklas Fasching
  • 1,326
  • 11
  • 15
4
votes
0 answers

Does Chromium support intercept WebWorker requests via CDP?

I'm trying to intercept WebWorker requests by sending Fetch.enable in a worker target session, but got a "'Fetch.enable' wasn't found" error from Chromium. Does that mean Chromium not support WebWorker request interception? My Chromium version is…
4
votes
3 answers

What does page._client do in Puppeteer?

I read the whole Puppeteer documentation, but unfortunately, they don't have any documentation for the _client property of page. So my question is, what is page._client ? And what is the difference between using await…
Movianlost
  • 226
  • 2
  • 8
4
votes
2 answers

Why isn't Network.enable found?

Here's my messages received via WebSocket. When I send this message: { id: 3, method: 'Network.enable' } ... it replies with: { id: 3, error: { code: -32601, message: "'Network.enable' wasn't found" } } It says the same for 'Page.navigate' as…
GirkovArpa
  • 4,427
  • 4
  • 14
  • 43
1
2 3
12 13