eric7/Documentation/Source/eric7.WebBrowser.GreaseMonkey.GreaseMonkeyScript.html

branch
eric7
changeset 8372
e0227a7c850e
child 8596
d64760b2da50
equal deleted inserted replaced
8371:d6062691d424 8372:e0227a7c850e
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.WebBrowser.GreaseMonkey.GreaseMonkeyScript</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.GreaseMonkeyScript</h1>
24
25 <p>
26 Module implementing the GreaseMonkey script.
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="#GreaseMonkeyScript">GreaseMonkeyScript</a></td>
39 <td>Class implementing the GreaseMonkey script.</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="GreaseMonkeyScript" ID="GreaseMonkeyScript"></a>
50 <h2>GreaseMonkeyScript</h2>
51
52 <p>
53 Class implementing the GreaseMonkey script.
54 </p>
55 <h3>Signals</h3>
56 <dl>
57
58 <dt>scriptChanged()</dt>
59 <dd>
60 emitted to indicate a script change
61 </dd>
62 <dt>updatingChanged(bool)</dt>
63 <dd>
64 emitted to indicate a change of the
65 updating state
66 </dd>
67 </dl>
68 <h3>Derived from</h3>
69 QObject
70 <h3>Class Attributes</h3>
71
72 <table>
73 <tr><td>DocumentEnd</td></tr><tr><td>DocumentIdle</td></tr><tr><td>DocumentStart</td></tr>
74 </table>
75 <h3>Class Methods</h3>
76
77 <table>
78 <tr><td>None</td></tr>
79 </table>
80 <h3>Methods</h3>
81
82 <table>
83
84 <tr>
85 <td><a href="#GreaseMonkeyScript.__init__">GreaseMonkeyScript</a></td>
86 <td>Constructor</td>
87 </tr>
88 <tr>
89 <td><a href="#GreaseMonkeyScript.__downloadIcon">__downloadIcon</a></td>
90 <td>Private slot to download the script icon.</td>
91 </tr>
92 <tr>
93 <td><a href="#GreaseMonkeyScript.__downloadRequires">__downloadRequires</a></td>
94 <td>Private method to download the required scripts.</td>
95 </tr>
96 <tr>
97 <td><a href="#GreaseMonkeyScript.__downloaderError">__downloaderError</a></td>
98 <td>Private slot to handle a downloader error.</td>
99 </tr>
100 <tr>
101 <td><a href="#GreaseMonkeyScript.__downloaderFinished">__downloaderFinished</a></td>
102 <td>Private slot to handle a finished download.</td>
103 </tr>
104 <tr>
105 <td><a href="#GreaseMonkeyScript.__iconDownloaded">__iconDownloaded</a></td>
106 <td>Private slot to handle a finished download of a script icon.</td>
107 </tr>
108 <tr>
109 <td><a href="#GreaseMonkeyScript.__parseScript">__parseScript</a></td>
110 <td>Private method to parse the given script and populate the data structure.</td>
111 </tr>
112 <tr>
113 <td><a href="#GreaseMonkeyScript.__reloadScript">__reloadScript</a></td>
114 <td>Private method to reload the script.</td>
115 </tr>
116 <tr>
117 <td><a href="#GreaseMonkeyScript.__requireDownloadError">__requireDownloadError</a></td>
118 <td>Private slot to handle a downloader error.</td>
119 </tr>
120 <tr>
121 <td><a href="#GreaseMonkeyScript.__requireDownloaded">__requireDownloaded</a></td>
122 <td>Private slot to handle a finished download of a required script.</td>
123 </tr>
124 <tr>
125 <td><a href="#GreaseMonkeyScript.__watchedFileChanged">__watchedFileChanged</a></td>
126 <td>Private slot handling changes of the script file.</td>
127 </tr>
128 <tr>
129 <td><a href="#GreaseMonkeyScript.description">description</a></td>
130 <td>Public method to get the description of the script.</td>
131 </tr>
132 <tr>
133 <td><a href="#GreaseMonkeyScript.downloadUrl">downloadUrl</a></td>
134 <td>Public method to get the download URL of the script.</td>
135 </tr>
136 <tr>
137 <td><a href="#GreaseMonkeyScript.exclude">exclude</a></td>
138 <td>Public method to get the list of excluded URLs.</td>
139 </tr>
140 <tr>
141 <td><a href="#GreaseMonkeyScript.fileName">fileName</a></td>
142 <td>Public method to get the path of the Javascript file.</td>
143 </tr>
144 <tr>
145 <td><a href="#GreaseMonkeyScript.fullName">fullName</a></td>
146 <td>Public method to get the full name of the script.</td>
147 </tr>
148 <tr>
149 <td><a href="#GreaseMonkeyScript.icon">icon</a></td>
150 <td>Public method to get the icon of the script.</td>
151 </tr>
152 <tr>
153 <td><a href="#GreaseMonkeyScript.iconUrl">iconUrl</a></td>
154 <td>Public method to get the icon URL of the script.</td>
155 </tr>
156 <tr>
157 <td><a href="#GreaseMonkeyScript.include">include</a></td>
158 <td>Public method to get the list of included URLs.</td>
159 </tr>
160 <tr>
161 <td><a href="#GreaseMonkeyScript.isEnabled">isEnabled</a></td>
162 <td>Public method to check, if the script is enabled.</td>
163 </tr>
164 <tr>
165 <td><a href="#GreaseMonkeyScript.isUpdating">isUpdating</a></td>
166 <td>Public method to get the updating flag.</td>
167 </tr>
168 <tr>
169 <td><a href="#GreaseMonkeyScript.isValid">isValid</a></td>
170 <td>Public method to check the validity of the script.</td>
171 </tr>
172 <tr>
173 <td><a href="#GreaseMonkeyScript.name">name</a></td>
174 <td>Public method to get the name of the script.</td>
175 </tr>
176 <tr>
177 <td><a href="#GreaseMonkeyScript.nameSpace">nameSpace</a></td>
178 <td>Public method to get the name space of the script.</td>
179 </tr>
180 <tr>
181 <td><a href="#GreaseMonkeyScript.noFrames">noFrames</a></td>
182 <td>Public method to get the noFrames flag.</td>
183 </tr>
184 <tr>
185 <td><a href="#GreaseMonkeyScript.require">require</a></td>
186 <td>Public method to get the list of required scripts.</td>
187 </tr>
188 <tr>
189 <td><a href="#GreaseMonkeyScript.setEnabled">setEnabled</a></td>
190 <td>Public method to enable a script.</td>
191 </tr>
192 <tr>
193 <td><a href="#GreaseMonkeyScript.startAt">startAt</a></td>
194 <td>Public method to get the start point of the script.</td>
195 </tr>
196 <tr>
197 <td><a href="#GreaseMonkeyScript.updateScript">updateScript</a></td>
198 <td>Public method to updated the script.</td>
199 </tr>
200 <tr>
201 <td><a href="#GreaseMonkeyScript.updateUrl">updateUrl</a></td>
202 <td>Public method to get the update URL of the script.</td>
203 </tr>
204 <tr>
205 <td><a href="#GreaseMonkeyScript.version">version</a></td>
206 <td>Public method to get the version of the script.</td>
207 </tr>
208 <tr>
209 <td><a href="#GreaseMonkeyScript.webScript">webScript</a></td>
210 <td>Public method to create a script object.</td>
211 </tr>
212 </table>
213 <h3>Static Methods</h3>
214
215 <table>
216 <tr><td>None</td></tr>
217 </table>
218
219 <a NAME="GreaseMonkeyScript.__init__" ID="GreaseMonkeyScript.__init__"></a>
220 <h4>GreaseMonkeyScript (Constructor)</h4>
221 <b>GreaseMonkeyScript</b>(<i>manager, path</i>)
222
223 <p>
224 Constructor
225 </p>
226 <dl>
227
228 <dt><i>manager</i></dt>
229 <dd>
230 reference to the manager object (GreaseMonkeyManager)
231 </dd>
232 <dt><i>path</i></dt>
233 <dd>
234 path of the Javascript file (string)
235 </dd>
236 </dl>
237 <a NAME="GreaseMonkeyScript.__downloadIcon" ID="GreaseMonkeyScript.__downloadIcon"></a>
238 <h4>GreaseMonkeyScript.__downloadIcon</h4>
239 <b>__downloadIcon</b>(<i></i>)
240
241 <p>
242 Private slot to download the script icon.
243 </p>
244 <a NAME="GreaseMonkeyScript.__downloadRequires" ID="GreaseMonkeyScript.__downloadRequires"></a>
245 <h4>GreaseMonkeyScript.__downloadRequires</h4>
246 <b>__downloadRequires</b>(<i></i>)
247
248 <p>
249 Private method to download the required scripts.
250 </p>
251 <a NAME="GreaseMonkeyScript.__downloaderError" ID="GreaseMonkeyScript.__downloaderError"></a>
252 <h4>GreaseMonkeyScript.__downloaderError</h4>
253 <b>__downloaderError</b>(<i>downloader</i>)
254
255 <p>
256 Private slot to handle a downloader error.
257 </p>
258 <dl>
259
260 <dt><i>downloader</i> (GreaseMonkeyDownloader)</dt>
261 <dd>
262 reference to the downloader object
263 </dd>
264 </dl>
265 <a NAME="GreaseMonkeyScript.__downloaderFinished" ID="GreaseMonkeyScript.__downloaderFinished"></a>
266 <h4>GreaseMonkeyScript.__downloaderFinished</h4>
267 <b>__downloaderFinished</b>(<i>downloader</i>)
268
269 <p>
270 Private slot to handle a finished download.
271 </p>
272 <dl>
273
274 <dt><i>downloader</i> (GreaseMonkeyDownloader)</dt>
275 <dd>
276 reference to the downloader object
277 </dd>
278 </dl>
279 <a NAME="GreaseMonkeyScript.__iconDownloaded" ID="GreaseMonkeyScript.__iconDownloaded"></a>
280 <h4>GreaseMonkeyScript.__iconDownloaded</h4>
281 <b>__iconDownloaded</b>(<i>reply</i>)
282
283 <p>
284 Private slot to handle a finished download of a script icon.
285 </p>
286 <dl>
287
288 <dt><i>reply</i> (QNetworkReply)</dt>
289 <dd>
290 reference to the network reply
291 </dd>
292 </dl>
293 <a NAME="GreaseMonkeyScript.__parseScript" ID="GreaseMonkeyScript.__parseScript"></a>
294 <h4>GreaseMonkeyScript.__parseScript</h4>
295 <b>__parseScript</b>(<i></i>)
296
297 <p>
298 Private method to parse the given script and populate the data
299 structure.
300 </p>
301 <a NAME="GreaseMonkeyScript.__reloadScript" ID="GreaseMonkeyScript.__reloadScript"></a>
302 <h4>GreaseMonkeyScript.__reloadScript</h4>
303 <b>__reloadScript</b>(<i></i>)
304
305 <p>
306 Private method to reload the script.
307 </p>
308 <a NAME="GreaseMonkeyScript.__requireDownloadError" ID="GreaseMonkeyScript.__requireDownloadError"></a>
309 <h4>GreaseMonkeyScript.__requireDownloadError</h4>
310 <b>__requireDownloadError</b>(<i>downloader</i>)
311
312 <p>
313 Private slot to handle a downloader error.
314 </p>
315 <dl>
316
317 <dt><i>downloader</i> (GreaseMonkeyDownloader)</dt>
318 <dd>
319 reference to the downloader object
320 </dd>
321 </dl>
322 <a NAME="GreaseMonkeyScript.__requireDownloaded" ID="GreaseMonkeyScript.__requireDownloaded"></a>
323 <h4>GreaseMonkeyScript.__requireDownloaded</h4>
324 <b>__requireDownloaded</b>(<i>downloader</i>)
325
326 <p>
327 Private slot to handle a finished download of a required script.
328 </p>
329 <dl>
330
331 <dt><i>downloader</i> (GreaseMonkeyDownloader)</dt>
332 <dd>
333 reference to the downloader object
334 </dd>
335 </dl>
336 <a NAME="GreaseMonkeyScript.__watchedFileChanged" ID="GreaseMonkeyScript.__watchedFileChanged"></a>
337 <h4>GreaseMonkeyScript.__watchedFileChanged</h4>
338 <b>__watchedFileChanged</b>(<i>fileName</i>)
339
340 <p>
341 Private slot handling changes of the script file.
342 </p>
343 <dl>
344
345 <dt><i>fileName</i> (str)</dt>
346 <dd>
347 path of the script file
348 </dd>
349 </dl>
350 <a NAME="GreaseMonkeyScript.description" ID="GreaseMonkeyScript.description"></a>
351 <h4>GreaseMonkeyScript.description</h4>
352 <b>description</b>(<i></i>)
353
354 <p>
355 Public method to get the description of the script.
356 </p>
357 <dl>
358 <dt>Return:</dt>
359 <dd>
360 description of the script (string)
361 </dd>
362 </dl>
363 <a NAME="GreaseMonkeyScript.downloadUrl" ID="GreaseMonkeyScript.downloadUrl"></a>
364 <h4>GreaseMonkeyScript.downloadUrl</h4>
365 <b>downloadUrl</b>(<i></i>)
366
367 <p>
368 Public method to get the download URL of the script.
369 </p>
370 <dl>
371 <dt>Return:</dt>
372 <dd>
373 download URL of the script (QUrl)
374 </dd>
375 </dl>
376 <a NAME="GreaseMonkeyScript.exclude" ID="GreaseMonkeyScript.exclude"></a>
377 <h4>GreaseMonkeyScript.exclude</h4>
378 <b>exclude</b>(<i></i>)
379
380 <p>
381 Public method to get the list of excluded URLs.
382 </p>
383 <dl>
384 <dt>Return:</dt>
385 <dd>
386 list of excluded URLs (list of strings)
387 </dd>
388 </dl>
389 <a NAME="GreaseMonkeyScript.fileName" ID="GreaseMonkeyScript.fileName"></a>
390 <h4>GreaseMonkeyScript.fileName</h4>
391 <b>fileName</b>(<i></i>)
392
393 <p>
394 Public method to get the path of the Javascript file.
395 </p>
396 <dl>
397 <dt>Return:</dt>
398 <dd>
399 path of the Javascript file (string)
400 </dd>
401 </dl>
402 <a NAME="GreaseMonkeyScript.fullName" ID="GreaseMonkeyScript.fullName"></a>
403 <h4>GreaseMonkeyScript.fullName</h4>
404 <b>fullName</b>(<i></i>)
405
406 <p>
407 Public method to get the full name of the script.
408 </p>
409 <dl>
410 <dt>Return:</dt>
411 <dd>
412 full name of the script (string)
413 </dd>
414 </dl>
415 <a NAME="GreaseMonkeyScript.icon" ID="GreaseMonkeyScript.icon"></a>
416 <h4>GreaseMonkeyScript.icon</h4>
417 <b>icon</b>(<i></i>)
418
419 <p>
420 Public method to get the icon of the script.
421 </p>
422 <dl>
423 <dt>Return:</dt>
424 <dd>
425 script icon
426 </dd>
427 </dl>
428 <dl>
429 <dt>Return Type:</dt>
430 <dd>
431 QIcon
432 </dd>
433 </dl>
434 <a NAME="GreaseMonkeyScript.iconUrl" ID="GreaseMonkeyScript.iconUrl"></a>
435 <h4>GreaseMonkeyScript.iconUrl</h4>
436 <b>iconUrl</b>(<i></i>)
437
438 <p>
439 Public method to get the icon URL of the script.
440 </p>
441 <dl>
442 <dt>Return:</dt>
443 <dd>
444 icon URL of the script (QUrl)
445 </dd>
446 </dl>
447 <a NAME="GreaseMonkeyScript.include" ID="GreaseMonkeyScript.include"></a>
448 <h4>GreaseMonkeyScript.include</h4>
449 <b>include</b>(<i></i>)
450
451 <p>
452 Public method to get the list of included URLs.
453 </p>
454 <dl>
455 <dt>Return:</dt>
456 <dd>
457 list of included URLs (list of strings)
458 </dd>
459 </dl>
460 <a NAME="GreaseMonkeyScript.isEnabled" ID="GreaseMonkeyScript.isEnabled"></a>
461 <h4>GreaseMonkeyScript.isEnabled</h4>
462 <b>isEnabled</b>(<i></i>)
463
464 <p>
465 Public method to check, if the script is enabled.
466 </p>
467 <dl>
468 <dt>Return:</dt>
469 <dd>
470 flag indicating an enabled state (boolean)
471 </dd>
472 </dl>
473 <a NAME="GreaseMonkeyScript.isUpdating" ID="GreaseMonkeyScript.isUpdating"></a>
474 <h4>GreaseMonkeyScript.isUpdating</h4>
475 <b>isUpdating</b>(<i></i>)
476
477 <p>
478 Public method to get the updating flag.
479 </p>
480 <dl>
481 <dt>Return:</dt>
482 <dd>
483 updating flag
484 </dd>
485 </dl>
486 <dl>
487 <dt>Return Type:</dt>
488 <dd>
489 bool
490 </dd>
491 </dl>
492 <a NAME="GreaseMonkeyScript.isValid" ID="GreaseMonkeyScript.isValid"></a>
493 <h4>GreaseMonkeyScript.isValid</h4>
494 <b>isValid</b>(<i></i>)
495
496 <p>
497 Public method to check the validity of the script.
498 </p>
499 <dl>
500 <dt>Return:</dt>
501 <dd>
502 flag indicating a valid script (boolean)
503 </dd>
504 </dl>
505 <a NAME="GreaseMonkeyScript.name" ID="GreaseMonkeyScript.name"></a>
506 <h4>GreaseMonkeyScript.name</h4>
507 <b>name</b>(<i></i>)
508
509 <p>
510 Public method to get the name of the script.
511 </p>
512 <dl>
513 <dt>Return:</dt>
514 <dd>
515 name of the script (string)
516 </dd>
517 </dl>
518 <a NAME="GreaseMonkeyScript.nameSpace" ID="GreaseMonkeyScript.nameSpace"></a>
519 <h4>GreaseMonkeyScript.nameSpace</h4>
520 <b>nameSpace</b>(<i></i>)
521
522 <p>
523 Public method to get the name space of the script.
524 </p>
525 <dl>
526 <dt>Return:</dt>
527 <dd>
528 name space of the script (string)
529 </dd>
530 </dl>
531 <a NAME="GreaseMonkeyScript.noFrames" ID="GreaseMonkeyScript.noFrames"></a>
532 <h4>GreaseMonkeyScript.noFrames</h4>
533 <b>noFrames</b>(<i></i>)
534
535 <p>
536 Public method to get the noFrames flag.
537 </p>
538 <dl>
539 <dt>Return:</dt>
540 <dd>
541 flag indicating to not run on sub frames
542 </dd>
543 </dl>
544 <dl>
545 <dt>Return Type:</dt>
546 <dd>
547 bool
548 </dd>
549 </dl>
550 <a NAME="GreaseMonkeyScript.require" ID="GreaseMonkeyScript.require"></a>
551 <h4>GreaseMonkeyScript.require</h4>
552 <b>require</b>(<i></i>)
553
554 <p>
555 Public method to get the list of required scripts.
556 </p>
557 <dl>
558 <dt>Return:</dt>
559 <dd>
560 list of required scripts (list of strings)
561 </dd>
562 </dl>
563 <a NAME="GreaseMonkeyScript.setEnabled" ID="GreaseMonkeyScript.setEnabled"></a>
564 <h4>GreaseMonkeyScript.setEnabled</h4>
565 <b>setEnabled</b>(<i>enable</i>)
566
567 <p>
568 Public method to enable a script.
569 </p>
570 <dl>
571
572 <dt><i>enable</i></dt>
573 <dd>
574 flag indicating the new enabled state (boolean)
575 </dd>
576 </dl>
577 <a NAME="GreaseMonkeyScript.startAt" ID="GreaseMonkeyScript.startAt"></a>
578 <h4>GreaseMonkeyScript.startAt</h4>
579 <b>startAt</b>(<i></i>)
580
581 <p>
582 Public method to get the start point of the script.
583 </p>
584 <dl>
585 <dt>Return:</dt>
586 <dd>
587 start point of the script (DocumentStart or DocumentEnd)
588 </dd>
589 </dl>
590 <a NAME="GreaseMonkeyScript.updateScript" ID="GreaseMonkeyScript.updateScript"></a>
591 <h4>GreaseMonkeyScript.updateScript</h4>
592 <b>updateScript</b>(<i></i>)
593
594 <p>
595 Public method to updated the script.
596 </p>
597 <a NAME="GreaseMonkeyScript.updateUrl" ID="GreaseMonkeyScript.updateUrl"></a>
598 <h4>GreaseMonkeyScript.updateUrl</h4>
599 <b>updateUrl</b>(<i></i>)
600
601 <p>
602 Public method to get the update URL of the script.
603 </p>
604 <dl>
605 <dt>Return:</dt>
606 <dd>
607 update URL of the script (QUrl)
608 </dd>
609 </dl>
610 <a NAME="GreaseMonkeyScript.version" ID="GreaseMonkeyScript.version"></a>
611 <h4>GreaseMonkeyScript.version</h4>
612 <b>version</b>(<i></i>)
613
614 <p>
615 Public method to get the version of the script.
616 </p>
617 <dl>
618 <dt>Return:</dt>
619 <dd>
620 version of the script (string)
621 </dd>
622 </dl>
623 <a NAME="GreaseMonkeyScript.webScript" ID="GreaseMonkeyScript.webScript"></a>
624 <h4>GreaseMonkeyScript.webScript</h4>
625 <b>webScript</b>(<i></i>)
626
627 <p>
628 Public method to create a script object.
629 </p>
630 <dl>
631 <dt>Return:</dt>
632 <dd>
633 prepared script object
634 </dd>
635 </dl>
636 <dl>
637 <dt>Return Type:</dt>
638 <dd>
639 QWebEngineScript
640 </dd>
641 </dl>
642 <div align="right"><a href="#top">Up</a></div>
643 <hr />
644 </body></html>

eric ide

mercurial