Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3584 | sourcerer | 1 | -------------------------------------------------------------------------------- |
2 | Usage Instructions for Monkey NetSurf 13 March 2011 |
||
3 | -------------------------------------------------------------------------------- |
||
4 | |||
5 | This document provides usage instructions for the Monkey version of |
||
6 | NetSurf. |
||
7 | |||
8 | Monkey NetSurf has been tested on Ubuntu. |
||
9 | |||
10 | Overview |
||
11 | ======== |
||
12 | |||
13 | What it is |
||
14 | ---------- |
||
15 | |||
16 | The NetSurf Monkey front end is a developer debug tool used to |
||
17 | test how the core interacts with the user interface. It allows |
||
18 | the developers to profile NetSurf and to interact with the core |
||
19 | directly as though the developer were a front end. |
||
20 | |||
21 | What it is not |
||
22 | -------------- |
||
23 | |||
24 | Monkey is not a tool for building web-crawling robots or indeed |
||
25 | anything other than a debug tool for the NetSurf developers. |
||
26 | |||
27 | How to interact with nsmonkey |
||
28 | ----------------------------- |
||
29 | |||
30 | In brief, monkey will produce tagged output on stdout and expect |
||
31 | commands on stdin. Windows are numbered and for the most part |
||
32 | tokens are space separated. In some cases (e.g. title or status) |
||
33 | the final element on the output line is a string which might have |
||
34 | spaces embedded within it. As such, output from nsmonkey should be |
||
35 | parsed a token at a time, so that when such a string is encountered, |
||
36 | the parser can stop splitting and return the rest. |
||
37 | |||
38 | Commands to Monkey are namespaced. For example commands related to |
||
39 | browser windows are prefixed by WINDOW. |
||
40 | |||
41 | Top level tags for nsmonkey |
||
42 | --------------------------- |
||
43 | |||
44 | QUIT |
||
45 | |||
46 | WINDOW |
||
47 | |||
48 | Top level response tags for nsmonkey |
||
49 | ------------------------------------ |
||
50 | |||
51 | GENERIC |
||
52 | |||
53 | WARN, ERROR, DIE |
||
54 | |||
55 | WINDOW |
||
56 | |||
57 | DOWNLOAD_WINDOW |
||
58 | |||
59 | SSLCERT |
||
60 | |||
61 | 401LOGIN |
||
62 | |||
63 | PLOT |
||
64 | |||
65 | In the below, %something% indicates a substitution made by Monkey. |
||
66 | |||
67 | %url% will be a URL |
||
68 | %id% will be an opaque ID |
||
69 | %n% will be a number |
||
70 | %bool% will be TRUE or FALSE |
||
71 | %str% is a string and will only ever be at the end of an output line. |
||
72 | |||
73 | Warnings, errors etc |
||
74 | -------------------- |
||
75 | |||
76 | Warnings (tagged WARN) come from the NetSurf core. |
||
77 | Errors (tagged ERROR) tend to come from Monkey's parsers |
||
78 | Death (tagged DIE) comes from the core and kills Monkey dead. |
||
79 | |||
80 | Commands |
||
81 | ======== |
||
82 | |||
83 | Generic commands |
||
84 | ---------------- |
||
85 | |||
86 | QUIT |
||
87 | Cause monkey to quit cleanly. |
||
88 | This will cleanly destroy open windows etc. |
||
89 | |||
90 | Window commands |
||
91 | --------------- |
||
92 | |||
93 | WINDOW NEW [%url%] |
||
94 | Create a new browser window, optionally giving the core |
||
95 | a URL to immediately navigate to. |
||
96 | Minimally you will receive a WINDOW NEW WIN %id% response. |
||
97 | |||
98 | WINDOW DESTROY %id% |
||
99 | Destroy the given browser window. |
||
100 | Minimally you will recieve a WINDOW DESTROY WIN %id% response. |
||
101 | |||
102 | WINDOW GO %id% %url% [%url%] |
||
103 | Cause the given browser window to visit the given URL. |
||
104 | Optionally you can give a referrer URL to also use (simulating |
||
105 | a click in the browser on a link). |
||
106 | Minimally you can expect throbber, url etc responses. |
||
107 | |||
108 | WINDOW REDRAW %id% [%num% %num% %num% %num%] |
||
109 | Cause a browser window to redraw. Optionally you can give a |
||
110 | set of coordinates to simulate a partial expose of the window. |
||
111 | Said coordinates are in traditional X0 Y0 X1 Y1 order. |
||
112 | The coordinates are in canvas, not window, coordinates. So you |
||
113 | should take into account the scroll offsets when issuing this |
||
114 | command. |
||
115 | Minimally you can expect redraw start/stop messages and you |
||
116 | can likely expect some number of PLOT results. |
||
117 | |||
118 | WINDOW RELOAD %id% |
||
119 | Cause a browser window to reload its current content. |
||
120 | Expect responses similar to a GO command. |
||
121 | |||
122 | |||
123 | Responses |
||
124 | ========= |
||
125 | |||
126 | Generic messages |
||
127 | ---------------- |
||
128 | |||
129 | GENERIC STARTED |
||
130 | Monkey has started and is ready for commands |
||
131 | |||
132 | GENERIC CLOSING_DOWN |
||
133 | Monkey has been told to shut down and is doing so |
||
134 | |||
135 | GENERIC FINISHED |
||
136 | Monkey has finished and will now exit |
||
137 | |||
138 | GENERIC LAUNCH URL %url% |
||
139 | The core asked monkey to launch the given URL |
||
140 | |||
141 | GENERIC THUMBNAIL URL %url% |
||
142 | The core asked monkey to thumbnail a content without |
||
143 | a window. |
||
144 | |||
145 | GENERIC POLL BLOCKING |
||
146 | Monkey reached a point where it could sleep waiting for |
||
147 | commands or scheduled timeouts. No fetches nor redraws |
||
148 | were pending. |
||
149 | |||
150 | Window messages |
||
151 | --------------- |
||
152 | |||
153 | WINDOW NEW WIN %id% FOR %id% CLONE %id% NEWTAB %bool% |
||
154 | The core asked Monkey to open a new window. The IDs for 'FOR' and |
||
155 | 'CLONE' are core window IDs, the WIN id is a Monkey window ID. |
||
156 | |||
157 | WINDOW SIZE WIN %id% WIDTH %n% HEIGHT %n% |
||
158 | The window specified has been set to the shown width and height. |
||
159 | |||
160 | WINDOW DESTROY WIN %id% |
||
161 | The core has instructed Monkey to destroy the named window. |
||
162 | |||
163 | WINDOW TITLE WIN %id% STR %str% |
||
164 | The core supplied a titlebar title for the given window. |
||
165 | |||
166 | WINDOW REDRAW WIN %id% |
||
167 | The core asked that Monkey redraw the given window. |
||
168 | |||
169 | WINDOW GET_DIMENSIONS WIN %id% WIDTH %n% HEIGHT %n% |
||
170 | The core asked Monkey what the dimensions of the window are. |
||
171 | Monkey has to respond immediately and returned the supplied width |
||
172 | and height values to the core. |
||
173 | |||
174 | WINDOW NEW_CONTENT WIN %id% |
||
175 | The core has informed Monkey that the named window has a new |
||
176 | content object. |
||
177 | |||
178 | WINDOW NEW_ICON WIN %id% |
||
179 | The core has informed Monkey that the named window hsa a new |
||
180 | icon (favicon) available. |
||
181 | |||
182 | WINDOW START_THROBBER WIN %id% |
||
183 | The core asked Monkey to start the throbber for the named |
||
184 | window. This indicates to the user that the window is busy. |
||
185 | |||
186 | WINDOW STOP_THROBBER WIN %id% |
||
187 | The core asked Monkey to stop the throbber for the named |
||
188 | window. This indicates to the user that the window is finished. |
||
189 | |||
190 | WINDOW SET_SCROLL WIN %id% X %n% Y %n% |
||
191 | The core asked Monkey to set the named window's scroll offsets |
||
192 | to the given X and Y position. |
||
193 | |||
194 | WINDOW UPDATE_BOX WIN %id% X %n% Y %n% WIDTH %n% HEIGHT %n% |
||
195 | The core asked Monkey to redraw the given portion of the content |
||
196 | display. Note these coordinates refer to the content, not the |
||
197 | viewport which Monkey is simulating. |
||
198 | |||
199 | WINDOW UPDATE_EXTENT WIN %id% WIDTH %n% HEIGHT %n% |
||
200 | The core has told us that the content in the given window has a |
||
201 | total width and height as shown. This allows us (along with the |
||
202 | window's width and height) to know the scroll limits. |
||
203 | |||
204 | WINDOW SET_STATUS WIN %id% STR %str% |
||
205 | The core has told us that the given window needs its status bar |
||
206 | updating with the given message. |
||
207 | |||
208 | WINDOW SET_POINTER WIN %id% POINTER %id% |
||
209 | The core has told us to update the mouse pointer for the given |
||
210 | window to the given pointer ID. |
||
211 | |||
212 | WINDOW SET_SCALE WIN %id% SCALE %n% |
||
213 | The core has asked us to scale the given window by the given scale |
||
214 | factor. |
||
215 | |||
216 | WINDOW SET_URL WIN %id% URL %url% |
||
217 | The core has informed us that the given window's URL bar needs |
||
218 | updating to the given url. |
||
219 | |||
220 | WINDOW GET_SCROLL WIN %id% X %n% Y %n% |
||
221 | The core asked Monkey for the scroll offsets. Monkey returned the |
||
222 | numbers shown for the window named. |
||
223 | |||
224 | WINDOW SCROLL_START WIN %id% |
||
225 | The core asked Monkey to scroll the named window to the top/left. |
||
226 | |||
227 | WINDOW POSITION_FRAME WIN %id% X0 %n% Y0 %n% X1 %n% Y1 %n% |
||
228 | The core asked Monkey to position the named window as a frame at |
||
229 | the given coordinates of its parent. |
||
230 | |||
231 | WINDOW SCROLL_VISIBLE WIN %id% X0 %n% Y0 %n% X1 %n% Y1 %n% |
||
232 | The core asked Monkey to scroll the named window until the |
||
233 | indicated box is visible. |
||
234 | |||
235 | WINDOW PLACE_CARET WIN %id% X %n% Y %n% HEIGHT %n% |
||
236 | The core asked Monkey to render a caret in the named window at the |
||
237 | indicated position with the indicated height. |
||
238 | |||
239 | WINDOW REMOVE_CARET WIN %id% |
||
240 | The core asked Monkey to remove any caret in the named window. |
||
241 | |||
242 | WINDOW SCROLL_START WIN %id% X0 %n% Y0 %n% X1 %n% Y1 %n% |
||
243 | The core asked Monkey to scroll the named window to the start of |
||
244 | the given box. |
||
245 | |||
246 | WINDOW SELECT_MENU WIN %id% |
||
247 | The core asked Monkey to produce a selection menu for the named |
||
248 | window. |
||
249 | |||
250 | WINDOW SAVE_LINK WIN %id% URL %url% TITLE %str% |
||
251 | The core asked Monkey to save a link from the given window with |
||
252 | the given URL and anchor title. |
||
253 | |||
254 | WINDOW THUMBNAIL WIN %id% URL %url% |
||
255 | The core asked Monkey to render a thumbnail for the given window |
||
256 | which is currently at the given URL. |
||
257 | |||
258 | WINDOW REDRAW WIN %id% START |
||
259 | WINDOW REDRAW WIN %id% STOP |
||
260 | The core wraps redraws in these messages. Thus PLOT responses can |
||
261 | be allocated to the appropriate window. |
||
262 | |||
263 | Download window messages |
||
264 | ------------------------ |
||
265 | |||
266 | DOWNLOAD_WINDOW CREATE DWIN %id% WIN %id% |
||
267 | The core asked Monkey to create a download window owned by the |
||
268 | given browser window. |
||
269 | |||
270 | DOWNLOAD_WINDOW DATA DWIN %id% SIZE %n% DATA %str% |
||
271 | The core asked Monkey to update the named download window with |
||
272 | the given byte size and data string. |
||
273 | |||
274 | DOWNLOAD_WINDOW ERROR DWIN %id% ERROR %str% |
||
275 | The core asked Monkey to update the named download window with |
||
276 | the given error message. |
||
277 | |||
278 | DOWNLOAD_WINDOW DONE DWIN %id% |
||
279 | The core asked Monkey to destroy the named download window. |
||
280 | |||
281 | SSL Certificate messages |
||
282 | ------------------------ |
||
283 | |||
284 | SSLCERT VERIFY CERT %id% URL %url% |
||
285 | The core asked Monkey to say whether or not a given SSL |
||
286 | certificate is OK. |
||
287 | |||
288 | 401 Login messages |
||
289 | ------------------ |
||
290 | |||
291 | 401LOGIN OPEN M4 %id% URL %url% REALM %str% |
||
292 | The core asked Monkey to ask for identification for the named |
||
293 | realm at the given URL. |
||
294 | |||
295 | Plotter messages |
||
296 | ---------------- |
||
297 | |||
298 | Note, Monkey won't clip coordinates, but sometimes the core does. |
||
299 | |||
300 | PLOT CLIP X0 %n% Y0 %n% X1 %n% Y1 %n% |
||
301 | The core asked Monkey to clip plotting to the given clipping |
||
302 | rectangle (X0,Y0) (X1,Y1) |
||
303 | |||
304 | PLOT TEXT X %n% Y %n% STR %str% |
||
305 | The core asked Monkey to plot the given string at the |
||
306 | given coordinates. |
||
307 | |||
308 | PLOT LINE X0 %n% Y0 %n% X1 %n% Y1 %n% |
||
309 | The core asked Monkey to plot a line with the given start |
||
310 | and end coordinates. |
||
311 | |||
312 | PLOT RECT X0 %n% Y0 %n% X1 %n% Y1 %n% |
||
313 | The core asked Monkey to plot a rectangle with the given |
||
314 | coordinates as the corners. |
||
315 | |||
316 | PLOT BITMAP X %n% Y %n% WIDTH %n% HEIGHT %n% |
||
317 | The core asked Monkey to plot a bitmap at the given |
||
318 | coordinates, scaled to the given width/height. |