Hi!
I want to remote debug from python script.
In dev tools settings page I have checked:
Enable browser chrome and add-on debugging toolboxes
Enable remote debugging
… (funda kabanzi)
Hi!
I want to remote debug from python script.
In dev tools settings page I have checked:
Enable browser chrome and add-on debugging toolboxes
Enable remote debugging
And when I check about:config there it also shows:
devtools.debugger.remote-enabled: true
devtools.debugger.remote-host: localhost
devtools.debugger.remote-port: 6000
devtools.debugger.remote-timeout: 20000
devtools.debugger.remote-websocket: true.
When I go to tools > browser tools > Browser toolbox then it asks if I want to allow connection and if I press ok then it works.
However when I run the following python code:
import asyncio
import websockets
async def connect_to_firefox():
async with websockets.connect('ws://localhost:49928/devtools/browser') as websocket:
# Now you have a connection to Firefox using the remote debugging protocol
# You can send commands and receive responses through the WebSocket connection
# For example, you can send a request to get the list of available browser tabs
request = '{"id": 1, "method": "Browser.getBrowserList", "params": {}}'
await websocket.send(request)
response = await websocket.recv()
print(response)
- Run the connection coroutine
asyncio.get_event_loop().run_until_complete(connect_to_firefox())
Then I get: ConnectionRefusedError: [WinError 1225] The remote computer refused the network connection
Question: Why does browser toolbox work but python script doesn't?