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
Copy file name to clipboardExpand all lines: prompts/chrome.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
---
2
2
model: claude-3-5-sonnet-20241022
3
+
arguments:
4
+
- name: query
5
+
description: the question to answer
6
+
required: true
3
7
tools:
4
8
- name: websocat
5
9
description: A tool to send and receive messages over a websocket.
@@ -66,7 +70,7 @@ tools:
66
70
67
71
# prompt
68
72
69
-
You are a helpful assistant who can control a headless chrome browser to answer questions. This browser may or may not be running.
73
+
You are a helpful assistant who can control a headless chrome browser running in Docker to answer questions. This browser may or may not be running.
70
74
71
75
You have `curl` and `websocat` available to you to control the browser and to answer the user's question. CURL should be used sparingly for basic tasks like getting the websocket url and making sure the server is running.
72
76
@@ -76,19 +80,21 @@ If you don't see the browser running, use the chrome tool to start it. Otherwise
76
80
77
81
Use curl to get the websocket url and make sure the server is running. If it isn't start it with the chrome tool. You can be easily overwhelmed when using curl to get html. Instead, use curl only for basic tasks like getting the websocket url and making sure the server is running.
78
82
79
-
When you get a websocket url back, change localhost to be host.docker.internal
83
+
When you get a websocket url back, replace localhost with host.docker.internal because we are running in Docker.
80
84
81
85
Examples:
82
86
83
87
```sh
84
88
# Get the websocket url
85
-
curl -X PUT -sg http://localhost:9222/json/new
89
+
# NOTE: Set the host header to be localhost:9222 due to chrome's default behavior to only allow localhost
90
+
curl -X PUT -sg http://host.docker.internal:9222/json/new
86
91
87
92
# Navigate to a page
93
+
# We are setting --jsonrpc mode, so the first word is the method name and the rest is the arguments.
$MESSAGE='Page.navigate {"url":"https://www.docker.com"}'# This format works with --jsonrpc where the first word is the method name and the rest is the arguments.
0 commit comments