|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.WebBrowser.GreaseMonkey.GreaseMonkeyManager</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.WebBrowser.GreaseMonkey.GreaseMonkeyManager</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the manager for GreaseMonkey scripts. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#GreaseMonkeyManager">GreaseMonkeyManager</a></td> |
|
39 <td>Class implementing the manager for GreaseMonkey scripts.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /> |
|
48 <hr /> |
|
49 <a NAME="GreaseMonkeyManager" ID="GreaseMonkeyManager"></a> |
|
50 <h2>GreaseMonkeyManager</h2> |
|
51 |
|
52 <p> |
|
53 Class implementing the manager for GreaseMonkey scripts. |
|
54 </p> |
|
55 <h3>Signals</h3> |
|
56 <dl> |
|
57 |
|
58 <dt>scriptsChanged()</dt> |
|
59 <dd> |
|
60 emitted to indicate a change of scripts |
|
61 </dd> |
|
62 </dl> |
|
63 <h3>Derived from</h3> |
|
64 QObject |
|
65 <h3>Class Attributes</h3> |
|
66 |
|
67 <table> |
|
68 <tr><td>None</td></tr> |
|
69 </table> |
|
70 <h3>Class Methods</h3> |
|
71 |
|
72 <table> |
|
73 <tr><td>None</td></tr> |
|
74 </table> |
|
75 <h3>Methods</h3> |
|
76 |
|
77 <table> |
|
78 |
|
79 <tr> |
|
80 <td><a href="#GreaseMonkeyManager.__init__">GreaseMonkeyManager</a></td> |
|
81 <td>Constructor</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#GreaseMonkeyManager.__downloaderFinished">__downloaderFinished</a></td> |
|
85 <td>Private slot to handle the completion of a script download.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#GreaseMonkeyManager.__load">__load</a></td> |
|
89 <td>Private slot to load the available scripts into the manager.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#GreaseMonkeyManager.__scriptChanged">__scriptChanged</a></td> |
|
93 <td>Private slot handling a changed script.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#GreaseMonkeyManager.addScript">addScript</a></td> |
|
97 <td>Public method to add a script.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#GreaseMonkeyManager.allScripts">allScripts</a></td> |
|
101 <td>Public method to get a list of all scripts.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#GreaseMonkeyManager.canRunOnScheme">canRunOnScheme</a></td> |
|
105 <td>Public method to check, if scripts can be run on a scheme.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#GreaseMonkeyManager.containsScript">containsScript</a></td> |
|
109 <td>Public method to check, if the given script exists.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#GreaseMonkeyManager.disableScript">disableScript</a></td> |
|
113 <td>Public method to disable the given script.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#GreaseMonkeyManager.doDownloadScript">doDownloadScript</a></td> |
|
117 <td>Public slot to download a GreaseMonkey script.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#GreaseMonkeyManager.downloadScript">downloadScript</a></td> |
|
121 <td>Public method to download a GreaseMonkey script.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#GreaseMonkeyManager.enableScript">enableScript</a></td> |
|
125 <td>Public method to enable the given script.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#GreaseMonkeyManager.removeScript">removeScript</a></td> |
|
129 <td>Public method to remove a script.</td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><a href="#GreaseMonkeyManager.requireScripts">requireScripts</a></td> |
|
133 <td>Public method to get the sources of all required scripts.</td> |
|
134 </tr> |
|
135 <tr> |
|
136 <td><a href="#GreaseMonkeyManager.requireScriptsDirectory">requireScriptsDirectory</a></td> |
|
137 <td>Public method to get the path of the scripts directory.</td> |
|
138 </tr> |
|
139 <tr> |
|
140 <td><a href="#GreaseMonkeyManager.saveConfiguration">saveConfiguration</a></td> |
|
141 <td>Public method to save the configuration.</td> |
|
142 </tr> |
|
143 <tr> |
|
144 <td><a href="#GreaseMonkeyManager.scriptsDirectory">scriptsDirectory</a></td> |
|
145 <td>Public method to get the path of the scripts directory.</td> |
|
146 </tr> |
|
147 <tr> |
|
148 <td><a href="#GreaseMonkeyManager.showConfigurationDialog">showConfigurationDialog</a></td> |
|
149 <td>Public method to show the configuration dialog.</td> |
|
150 </tr> |
|
151 </table> |
|
152 <h3>Static Methods</h3> |
|
153 |
|
154 <table> |
|
155 <tr><td>None</td></tr> |
|
156 </table> |
|
157 |
|
158 <a NAME="GreaseMonkeyManager.__init__" ID="GreaseMonkeyManager.__init__"></a> |
|
159 <h4>GreaseMonkeyManager (Constructor)</h4> |
|
160 <b>GreaseMonkeyManager</b>(<i>parent=None</i>) |
|
161 |
|
162 <p> |
|
163 Constructor |
|
164 </p> |
|
165 <dl> |
|
166 |
|
167 <dt><i>parent</i></dt> |
|
168 <dd> |
|
169 reference to the parent object (QObject) |
|
170 </dd> |
|
171 </dl> |
|
172 <a NAME="GreaseMonkeyManager.__downloaderFinished" ID="GreaseMonkeyManager.__downloaderFinished"></a> |
|
173 <h4>GreaseMonkeyManager.__downloaderFinished</h4> |
|
174 <b>__downloaderFinished</b>(<i>fileName, downloader</i>) |
|
175 |
|
176 <p> |
|
177 Private slot to handle the completion of a script download. |
|
178 </p> |
|
179 <dl> |
|
180 |
|
181 <dt><i>fileName</i> (str)</dt> |
|
182 <dd> |
|
183 name of the downloaded script |
|
184 </dd> |
|
185 <dt><i>downloader</i> (GreaseMonkeyDownloader)</dt> |
|
186 <dd> |
|
187 reference to the downloader object |
|
188 </dd> |
|
189 </dl> |
|
190 <a NAME="GreaseMonkeyManager.__load" ID="GreaseMonkeyManager.__load"></a> |
|
191 <h4>GreaseMonkeyManager.__load</h4> |
|
192 <b>__load</b>(<i></i>) |
|
193 |
|
194 <p> |
|
195 Private slot to load the available scripts into the manager. |
|
196 </p> |
|
197 <a NAME="GreaseMonkeyManager.__scriptChanged" ID="GreaseMonkeyManager.__scriptChanged"></a> |
|
198 <h4>GreaseMonkeyManager.__scriptChanged</h4> |
|
199 <b>__scriptChanged</b>(<i>script</i>) |
|
200 |
|
201 <p> |
|
202 Private slot handling a changed script. |
|
203 </p> |
|
204 <dl> |
|
205 |
|
206 <dt><i>script</i> (GreaseMonkeyScript)</dt> |
|
207 <dd> |
|
208 reference to the changed script |
|
209 </dd> |
|
210 </dl> |
|
211 <a NAME="GreaseMonkeyManager.addScript" ID="GreaseMonkeyManager.addScript"></a> |
|
212 <h4>GreaseMonkeyManager.addScript</h4> |
|
213 <b>addScript</b>(<i>script</i>) |
|
214 |
|
215 <p> |
|
216 Public method to add a script. |
|
217 </p> |
|
218 <dl> |
|
219 |
|
220 <dt><i>script</i></dt> |
|
221 <dd> |
|
222 script to be added (GreaseMonkeyScript) |
|
223 </dd> |
|
224 </dl> |
|
225 <dl> |
|
226 <dt>Return:</dt> |
|
227 <dd> |
|
228 flag indicating success (boolean) |
|
229 </dd> |
|
230 </dl> |
|
231 <a NAME="GreaseMonkeyManager.allScripts" ID="GreaseMonkeyManager.allScripts"></a> |
|
232 <h4>GreaseMonkeyManager.allScripts</h4> |
|
233 <b>allScripts</b>(<i></i>) |
|
234 |
|
235 <p> |
|
236 Public method to get a list of all scripts. |
|
237 </p> |
|
238 <dl> |
|
239 <dt>Return:</dt> |
|
240 <dd> |
|
241 list of all scripts (list of GreaseMonkeyScript) |
|
242 </dd> |
|
243 </dl> |
|
244 <a NAME="GreaseMonkeyManager.canRunOnScheme" ID="GreaseMonkeyManager.canRunOnScheme"></a> |
|
245 <h4>GreaseMonkeyManager.canRunOnScheme</h4> |
|
246 <b>canRunOnScheme</b>(<i>scheme</i>) |
|
247 |
|
248 <p> |
|
249 Public method to check, if scripts can be run on a scheme. |
|
250 </p> |
|
251 <dl> |
|
252 |
|
253 <dt><i>scheme</i></dt> |
|
254 <dd> |
|
255 scheme to check (string) |
|
256 </dd> |
|
257 </dl> |
|
258 <dl> |
|
259 <dt>Return:</dt> |
|
260 <dd> |
|
261 flag indicating, that scripts can be run (boolean) |
|
262 </dd> |
|
263 </dl> |
|
264 <a NAME="GreaseMonkeyManager.containsScript" ID="GreaseMonkeyManager.containsScript"></a> |
|
265 <h4>GreaseMonkeyManager.containsScript</h4> |
|
266 <b>containsScript</b>(<i>fullName</i>) |
|
267 |
|
268 <p> |
|
269 Public method to check, if the given script exists. |
|
270 </p> |
|
271 <dl> |
|
272 |
|
273 <dt><i>fullName</i></dt> |
|
274 <dd> |
|
275 full name of the script (string) |
|
276 </dd> |
|
277 </dl> |
|
278 <dl> |
|
279 <dt>Return:</dt> |
|
280 <dd> |
|
281 flag indicating the existence (boolean) |
|
282 </dd> |
|
283 </dl> |
|
284 <a NAME="GreaseMonkeyManager.disableScript" ID="GreaseMonkeyManager.disableScript"></a> |
|
285 <h4>GreaseMonkeyManager.disableScript</h4> |
|
286 <b>disableScript</b>(<i>script</i>) |
|
287 |
|
288 <p> |
|
289 Public method to disable the given script. |
|
290 </p> |
|
291 <dl> |
|
292 |
|
293 <dt><i>script</i></dt> |
|
294 <dd> |
|
295 script to be disabled (GreaseMonkeyScript) |
|
296 </dd> |
|
297 </dl> |
|
298 <a NAME="GreaseMonkeyManager.doDownloadScript" ID="GreaseMonkeyManager.doDownloadScript"></a> |
|
299 <h4>GreaseMonkeyManager.doDownloadScript</h4> |
|
300 <b>doDownloadScript</b>(<i>url</i>) |
|
301 |
|
302 <p> |
|
303 Public slot to download a GreaseMonkey script. |
|
304 </p> |
|
305 <p> |
|
306 Note: The download needed to be separated in the invoking part |
|
307 (s.a.) and the one doing the real download because the invoking |
|
308 part runs in a different thread (i.e. the web engine thread). |
|
309 </p> |
|
310 <dl> |
|
311 |
|
312 <dt><i>url</i> (QUrl)</dt> |
|
313 <dd> |
|
314 URL to download script from |
|
315 </dd> |
|
316 </dl> |
|
317 <a NAME="GreaseMonkeyManager.downloadScript" ID="GreaseMonkeyManager.downloadScript"></a> |
|
318 <h4>GreaseMonkeyManager.downloadScript</h4> |
|
319 <b>downloadScript</b>(<i>url</i>) |
|
320 |
|
321 <p> |
|
322 Public method to download a GreaseMonkey script. |
|
323 </p> |
|
324 <dl> |
|
325 |
|
326 <dt><i>url</i> (QUrl)</dt> |
|
327 <dd> |
|
328 URL to download script from |
|
329 </dd> |
|
330 </dl> |
|
331 <a NAME="GreaseMonkeyManager.enableScript" ID="GreaseMonkeyManager.enableScript"></a> |
|
332 <h4>GreaseMonkeyManager.enableScript</h4> |
|
333 <b>enableScript</b>(<i>script</i>) |
|
334 |
|
335 <p> |
|
336 Public method to enable the given script. |
|
337 </p> |
|
338 <dl> |
|
339 |
|
340 <dt><i>script</i></dt> |
|
341 <dd> |
|
342 script to be enabled (GreaseMonkeyScript) |
|
343 </dd> |
|
344 </dl> |
|
345 <a NAME="GreaseMonkeyManager.removeScript" ID="GreaseMonkeyManager.removeScript"></a> |
|
346 <h4>GreaseMonkeyManager.removeScript</h4> |
|
347 <b>removeScript</b>(<i>script, removeFile=True</i>) |
|
348 |
|
349 <p> |
|
350 Public method to remove a script. |
|
351 </p> |
|
352 <dl> |
|
353 |
|
354 <dt><i>script</i></dt> |
|
355 <dd> |
|
356 script to be removed (GreaseMonkeyScript) |
|
357 </dd> |
|
358 <dt><i>removeFile</i></dt> |
|
359 <dd> |
|
360 flag indicating to remove the script file as well |
|
361 (bool) |
|
362 </dd> |
|
363 </dl> |
|
364 <dl> |
|
365 <dt>Return:</dt> |
|
366 <dd> |
|
367 flag indicating success (boolean) |
|
368 </dd> |
|
369 </dl> |
|
370 <a NAME="GreaseMonkeyManager.requireScripts" ID="GreaseMonkeyManager.requireScripts"></a> |
|
371 <h4>GreaseMonkeyManager.requireScripts</h4> |
|
372 <b>requireScripts</b>(<i>urlList</i>) |
|
373 |
|
374 <p> |
|
375 Public method to get the sources of all required scripts. |
|
376 </p> |
|
377 <dl> |
|
378 |
|
379 <dt><i>urlList</i></dt> |
|
380 <dd> |
|
381 list of URLs (list of string) |
|
382 </dd> |
|
383 </dl> |
|
384 <dl> |
|
385 <dt>Return:</dt> |
|
386 <dd> |
|
387 sources of all required scripts (string) |
|
388 </dd> |
|
389 </dl> |
|
390 <a NAME="GreaseMonkeyManager.requireScriptsDirectory" ID="GreaseMonkeyManager.requireScriptsDirectory"></a> |
|
391 <h4>GreaseMonkeyManager.requireScriptsDirectory</h4> |
|
392 <b>requireScriptsDirectory</b>(<i></i>) |
|
393 |
|
394 <p> |
|
395 Public method to get the path of the scripts directory. |
|
396 </p> |
|
397 <dl> |
|
398 <dt>Return:</dt> |
|
399 <dd> |
|
400 path of the scripts directory (string) |
|
401 </dd> |
|
402 </dl> |
|
403 <a NAME="GreaseMonkeyManager.saveConfiguration" ID="GreaseMonkeyManager.saveConfiguration"></a> |
|
404 <h4>GreaseMonkeyManager.saveConfiguration</h4> |
|
405 <b>saveConfiguration</b>(<i></i>) |
|
406 |
|
407 <p> |
|
408 Public method to save the configuration. |
|
409 </p> |
|
410 <a NAME="GreaseMonkeyManager.scriptsDirectory" ID="GreaseMonkeyManager.scriptsDirectory"></a> |
|
411 <h4>GreaseMonkeyManager.scriptsDirectory</h4> |
|
412 <b>scriptsDirectory</b>(<i></i>) |
|
413 |
|
414 <p> |
|
415 Public method to get the path of the scripts directory. |
|
416 </p> |
|
417 <dl> |
|
418 <dt>Return:</dt> |
|
419 <dd> |
|
420 path of the scripts directory (string) |
|
421 </dd> |
|
422 </dl> |
|
423 <a NAME="GreaseMonkeyManager.showConfigurationDialog" ID="GreaseMonkeyManager.showConfigurationDialog"></a> |
|
424 <h4>GreaseMonkeyManager.showConfigurationDialog</h4> |
|
425 <b>showConfigurationDialog</b>(<i>parent=None</i>) |
|
426 |
|
427 <p> |
|
428 Public method to show the configuration dialog. |
|
429 </p> |
|
430 <dl> |
|
431 |
|
432 <dt><i>parent</i></dt> |
|
433 <dd> |
|
434 reference to the parent widget (QWidget) |
|
435 </dd> |
|
436 </dl> |
|
437 <div align="right"><a href="#top">Up</a></div> |
|
438 <hr /> |
|
439 </body></html> |