41 <hr /><hr /> |
41 <hr /><hr /> |
42 <a NAME="GreaseMonkeyScript" ID="GreaseMonkeyScript"></a> |
42 <a NAME="GreaseMonkeyScript" ID="GreaseMonkeyScript"></a> |
43 <h2>GreaseMonkeyScript</h2> |
43 <h2>GreaseMonkeyScript</h2> |
44 <p> |
44 <p> |
45 Class implementing the GreaseMonkey script. |
45 Class implementing the GreaseMonkey script. |
46 </p> |
46 </p><h3>Signals</h3> |
|
47 <dl> |
|
48 <dt>scriptChanged()</dt> |
|
49 <dd> |
|
50 emitted to indicate a script change |
|
51 </dd><dt>updatingChanged(bool)</dt> |
|
52 <dd> |
|
53 emitted to indicate a change of the |
|
54 updating state |
|
55 </dd> |
|
56 </dl> |
47 <h3>Derived from</h3> |
57 <h3>Derived from</h3> |
48 QObject |
58 QObject |
49 <h3>Class Attributes</h3> |
59 <h3>Class Attributes</h3> |
50 <table> |
60 <table> |
51 <tr><td>DocumentEnd</td></tr><tr><td>DocumentIdle</td></tr><tr><td>DocumentStart</td></tr> |
61 <tr><td>DocumentEnd</td></tr><tr><td>DocumentIdle</td></tr><tr><td>DocumentStart</td></tr> |
58 <table> |
68 <table> |
59 <tr> |
69 <tr> |
60 <td><a href="#GreaseMonkeyScript.__init__">GreaseMonkeyScript</a></td> |
70 <td><a href="#GreaseMonkeyScript.__init__">GreaseMonkeyScript</a></td> |
61 <td>Constructor</td> |
71 <td>Constructor</td> |
62 </tr><tr> |
72 </tr><tr> |
|
73 <td><a href="#GreaseMonkeyScript.__downloadRequires">__downloadRequires</a></td> |
|
74 <td>Private method to download the required scripts.</td> |
|
75 </tr><tr> |
|
76 <td><a href="#GreaseMonkeyScript.__downloaderError">__downloaderError</a></td> |
|
77 <td>Private slot to handle a downloader error.</td> |
|
78 </tr><tr> |
|
79 <td><a href="#GreaseMonkeyScript.__downloaderFinished">__downloaderFinished</a></td> |
|
80 <td>Private slot to handle a finished download.</td> |
|
81 </tr><tr> |
63 <td><a href="#GreaseMonkeyScript.__parseScript">__parseScript</a></td> |
82 <td><a href="#GreaseMonkeyScript.__parseScript">__parseScript</a></td> |
64 <td>Private method to parse the given script and populate the data structure.</td> |
83 <td>Private method to parse the given script and populate the data structure.</td> |
65 </tr><tr> |
84 </tr><tr> |
|
85 <td><a href="#GreaseMonkeyScript.__reloadScript">__reloadScript</a></td> |
|
86 <td>Private method to reload the script.</td> |
|
87 </tr><tr> |
|
88 <td><a href="#GreaseMonkeyScript.__requireDownloadError">__requireDownloadError</a></td> |
|
89 <td>Private slot to handle a downloader error.</td> |
|
90 </tr><tr> |
|
91 <td><a href="#GreaseMonkeyScript.__requireDownloaded">__requireDownloaded</a></td> |
|
92 <td>Private slot to handle a finished download of a required script.</td> |
|
93 </tr><tr> |
66 <td><a href="#GreaseMonkeyScript.__toJavaScriptList">__toJavaScriptList</a></td> |
94 <td><a href="#GreaseMonkeyScript.__toJavaScriptList">__toJavaScriptList</a></td> |
67 <td>Private method to convert a list of str to a string containing a valid JavaScript list definition.</td> |
95 <td>Private method to convert a list of str to a string containing a valid JavaScript list definition.</td> |
68 </tr><tr> |
96 </tr><tr> |
69 <td><a href="#GreaseMonkeyScript.__watchedFileChanged">__watchedFileChanged</a></td> |
97 <td><a href="#GreaseMonkeyScript.__watchedFileChanged">__watchedFileChanged</a></td> |
70 <td>Private slot handling changes of the script file.</td> |
98 <td>Private slot handling changes of the script file.</td> |
88 <td>Public method to get the list of included URLs.</td> |
116 <td>Public method to get the list of included URLs.</td> |
89 </tr><tr> |
117 </tr><tr> |
90 <td><a href="#GreaseMonkeyScript.isEnabled">isEnabled</a></td> |
118 <td><a href="#GreaseMonkeyScript.isEnabled">isEnabled</a></td> |
91 <td>Public method to check, if the script is enabled.</td> |
119 <td>Public method to check, if the script is enabled.</td> |
92 </tr><tr> |
120 </tr><tr> |
|
121 <td><a href="#GreaseMonkeyScript.isUpdating">isUpdating</a></td> |
|
122 <td>Public method to get the updating flag.</td> |
|
123 </tr><tr> |
93 <td><a href="#GreaseMonkeyScript.isValid">isValid</a></td> |
124 <td><a href="#GreaseMonkeyScript.isValid">isValid</a></td> |
94 <td>Public method to check the validity of the script.</td> |
125 <td>Public method to check the validity of the script.</td> |
95 </tr><tr> |
126 </tr><tr> |
96 <td><a href="#GreaseMonkeyScript.name">name</a></td> |
127 <td><a href="#GreaseMonkeyScript.name">name</a></td> |
97 <td>Public method to get the name of the script.</td> |
128 <td>Public method to get the name of the script.</td> |
100 <td>Public method to get the name space of the script.</td> |
131 <td>Public method to get the name space of the script.</td> |
101 </tr><tr> |
132 </tr><tr> |
102 <td><a href="#GreaseMonkeyScript.noFrames">noFrames</a></td> |
133 <td><a href="#GreaseMonkeyScript.noFrames">noFrames</a></td> |
103 <td>Public method to get the noFrames flag.</td> |
134 <td>Public method to get the noFrames flag.</td> |
104 </tr><tr> |
135 </tr><tr> |
105 <td><a href="#GreaseMonkeyScript.script">script</a></td> |
136 <td><a href="#GreaseMonkeyScript.require">require</a></td> |
106 <td>Public method to get the Javascript source.</td> |
137 <td>Public method to get the list of required scripts.</td> |
107 </tr><tr> |
138 </tr><tr> |
108 <td><a href="#GreaseMonkeyScript.setEnabled">setEnabled</a></td> |
139 <td><a href="#GreaseMonkeyScript.setEnabled">setEnabled</a></td> |
109 <td>Public method to enable a script.</td> |
140 <td>Public method to enable a script.</td> |
110 </tr><tr> |
141 </tr><tr> |
111 <td><a href="#GreaseMonkeyScript.startAt">startAt</a></td> |
142 <td><a href="#GreaseMonkeyScript.startAt">startAt</a></td> |
112 <td>Public method to get the start point of the script.</td> |
143 <td>Public method to get the start point of the script.</td> |
|
144 </tr><tr> |
|
145 <td><a href="#GreaseMonkeyScript.updateScript">updateScript</a></td> |
|
146 <td>Public method to updated the script.</td> |
113 </tr><tr> |
147 </tr><tr> |
114 <td><a href="#GreaseMonkeyScript.updateUrl">updateUrl</a></td> |
148 <td><a href="#GreaseMonkeyScript.updateUrl">updateUrl</a></td> |
115 <td>Public method to get the update URL of the script.</td> |
149 <td>Public method to get the update URL of the script.</td> |
116 </tr><tr> |
150 </tr><tr> |
117 <td><a href="#GreaseMonkeyScript.version">version</a></td> |
151 <td><a href="#GreaseMonkeyScript.version">version</a></td> |
136 reference to the manager object (GreaseMonkeyManager) |
170 reference to the manager object (GreaseMonkeyManager) |
137 </dd><dt><i>path</i></dt> |
171 </dd><dt><i>path</i></dt> |
138 <dd> |
172 <dd> |
139 path of the Javascript file (string) |
173 path of the Javascript file (string) |
140 </dd> |
174 </dd> |
141 </dl><a NAME="GreaseMonkeyScript.__parseScript" ID="GreaseMonkeyScript.__parseScript"></a> |
175 </dl><a NAME="GreaseMonkeyScript.__downloadRequires" ID="GreaseMonkeyScript.__downloadRequires"></a> |
|
176 <h4>GreaseMonkeyScript.__downloadRequires</h4> |
|
177 <b>__downloadRequires</b>(<i></i>) |
|
178 <p> |
|
179 Private method to download the required scripts. |
|
180 </p><a NAME="GreaseMonkeyScript.__downloaderError" ID="GreaseMonkeyScript.__downloaderError"></a> |
|
181 <h4>GreaseMonkeyScript.__downloaderError</h4> |
|
182 <b>__downloaderError</b>(<i></i>) |
|
183 <p> |
|
184 Private slot to handle a downloader error. |
|
185 </p><a NAME="GreaseMonkeyScript.__downloaderFinished" ID="GreaseMonkeyScript.__downloaderFinished"></a> |
|
186 <h4>GreaseMonkeyScript.__downloaderFinished</h4> |
|
187 <b>__downloaderFinished</b>(<i></i>) |
|
188 <p> |
|
189 Private slot to handle a finished download. |
|
190 </p><a NAME="GreaseMonkeyScript.__parseScript" ID="GreaseMonkeyScript.__parseScript"></a> |
142 <h4>GreaseMonkeyScript.__parseScript</h4> |
191 <h4>GreaseMonkeyScript.__parseScript</h4> |
143 <b>__parseScript</b>(<i></i>) |
192 <b>__parseScript</b>(<i></i>) |
144 <p> |
193 <p> |
145 Private method to parse the given script and populate the data |
194 Private method to parse the given script and populate the data |
146 structure. |
195 structure. |
|
196 </p><a NAME="GreaseMonkeyScript.__reloadScript" ID="GreaseMonkeyScript.__reloadScript"></a> |
|
197 <h4>GreaseMonkeyScript.__reloadScript</h4> |
|
198 <b>__reloadScript</b>(<i></i>) |
|
199 <p> |
|
200 Private method to reload the script. |
|
201 </p><a NAME="GreaseMonkeyScript.__requireDownloadError" ID="GreaseMonkeyScript.__requireDownloadError"></a> |
|
202 <h4>GreaseMonkeyScript.__requireDownloadError</h4> |
|
203 <b>__requireDownloadError</b>(<i></i>) |
|
204 <p> |
|
205 Private slot to handle a downloader error. |
|
206 </p><a NAME="GreaseMonkeyScript.__requireDownloaded" ID="GreaseMonkeyScript.__requireDownloaded"></a> |
|
207 <h4>GreaseMonkeyScript.__requireDownloaded</h4> |
|
208 <b>__requireDownloaded</b>(<i></i>) |
|
209 <p> |
|
210 Private slot to handle a finished download of a required script. |
147 </p><a NAME="GreaseMonkeyScript.__toJavaScriptList" ID="GreaseMonkeyScript.__toJavaScriptList"></a> |
211 </p><a NAME="GreaseMonkeyScript.__toJavaScriptList" ID="GreaseMonkeyScript.__toJavaScriptList"></a> |
148 <h4>GreaseMonkeyScript.__toJavaScriptList</h4> |
212 <h4>GreaseMonkeyScript.__toJavaScriptList</h4> |
149 <b>__toJavaScriptList</b>(<i>patterns</i>) |
213 <b>__toJavaScriptList</b>(<i>patterns</i>) |
150 <p> |
214 <p> |
151 Private method to convert a list of str to a string containing a valid |
215 Private method to convert a list of str to a string containing a valid |
211 <p> |
275 <p> |
212 Public method to get the path of the Javascript file. |
276 Public method to get the path of the Javascript file. |
213 </p><dl> |
277 </p><dl> |
214 <dt>Returns:</dt> |
278 <dt>Returns:</dt> |
215 <dd> |
279 <dd> |
216 path path of the Javascript file (string) |
280 path of the Javascript file (string) |
217 </dd> |
281 </dd> |
218 </dl><a NAME="GreaseMonkeyScript.fullName" ID="GreaseMonkeyScript.fullName"></a> |
282 </dl><a NAME="GreaseMonkeyScript.fullName" ID="GreaseMonkeyScript.fullName"></a> |
219 <h4>GreaseMonkeyScript.fullName</h4> |
283 <h4>GreaseMonkeyScript.fullName</h4> |
220 <b>fullName</b>(<i></i>) |
284 <b>fullName</b>(<i></i>) |
221 <p> |
285 <p> |
243 </p><dl> |
307 </p><dl> |
244 <dt>Returns:</dt> |
308 <dt>Returns:</dt> |
245 <dd> |
309 <dd> |
246 flag indicating an enabled state (boolean) |
310 flag indicating an enabled state (boolean) |
247 </dd> |
311 </dd> |
|
312 </dl><a NAME="GreaseMonkeyScript.isUpdating" ID="GreaseMonkeyScript.isUpdating"></a> |
|
313 <h4>GreaseMonkeyScript.isUpdating</h4> |
|
314 <b>isUpdating</b>(<i></i>) |
|
315 <p> |
|
316 Public method to get the updating flag. |
|
317 </p><dl> |
|
318 <dt>Returns:</dt> |
|
319 <dd> |
|
320 updating flag |
|
321 </dd> |
|
322 </dl><dl> |
|
323 <dt>Return Type:</dt> |
|
324 <dd> |
|
325 bool |
|
326 </dd> |
248 </dl><a NAME="GreaseMonkeyScript.isValid" ID="GreaseMonkeyScript.isValid"></a> |
327 </dl><a NAME="GreaseMonkeyScript.isValid" ID="GreaseMonkeyScript.isValid"></a> |
249 <h4>GreaseMonkeyScript.isValid</h4> |
328 <h4>GreaseMonkeyScript.isValid</h4> |
250 <b>isValid</b>(<i></i>) |
329 <b>isValid</b>(<i></i>) |
251 <p> |
330 <p> |
252 Public method to check the validity of the script. |
331 Public method to check the validity of the script. |
288 </dl><dl> |
367 </dl><dl> |
289 <dt>Return Type:</dt> |
368 <dt>Return Type:</dt> |
290 <dd> |
369 <dd> |
291 bool |
370 bool |
292 </dd> |
371 </dd> |
293 </dl><a NAME="GreaseMonkeyScript.script" ID="GreaseMonkeyScript.script"></a> |
372 </dl><a NAME="GreaseMonkeyScript.require" ID="GreaseMonkeyScript.require"></a> |
294 <h4>GreaseMonkeyScript.script</h4> |
373 <h4>GreaseMonkeyScript.require</h4> |
295 <b>script</b>(<i></i>) |
374 <b>require</b>(<i></i>) |
296 <p> |
375 <p> |
297 Public method to get the Javascript source. |
376 Public method to get the list of required scripts. |
298 </p><dl> |
377 </p><dl> |
299 <dt>Returns:</dt> |
378 <dt>Returns:</dt> |
300 <dd> |
379 <dd> |
301 Javascript source (string) |
380 list of required scripts (list of strings) |
302 </dd> |
381 </dd> |
303 </dl><a NAME="GreaseMonkeyScript.setEnabled" ID="GreaseMonkeyScript.setEnabled"></a> |
382 </dl><a NAME="GreaseMonkeyScript.setEnabled" ID="GreaseMonkeyScript.setEnabled"></a> |
304 <h4>GreaseMonkeyScript.setEnabled</h4> |
383 <h4>GreaseMonkeyScript.setEnabled</h4> |
305 <b>setEnabled</b>(<i>enable</i>) |
384 <b>setEnabled</b>(<i>enable</i>) |
306 <p> |
385 <p> |
318 </p><dl> |
397 </p><dl> |
319 <dt>Returns:</dt> |
398 <dt>Returns:</dt> |
320 <dd> |
399 <dd> |
321 start point of the script (DocumentStart or DocumentEnd) |
400 start point of the script (DocumentStart or DocumentEnd) |
322 </dd> |
401 </dd> |
323 </dl><a NAME="GreaseMonkeyScript.updateUrl" ID="GreaseMonkeyScript.updateUrl"></a> |
402 </dl><a NAME="GreaseMonkeyScript.updateScript" ID="GreaseMonkeyScript.updateScript"></a> |
|
403 <h4>GreaseMonkeyScript.updateScript</h4> |
|
404 <b>updateScript</b>(<i></i>) |
|
405 <p> |
|
406 Public method to updated the script. |
|
407 </p><a NAME="GreaseMonkeyScript.updateUrl" ID="GreaseMonkeyScript.updateUrl"></a> |
324 <h4>GreaseMonkeyScript.updateUrl</h4> |
408 <h4>GreaseMonkeyScript.updateUrl</h4> |
325 <b>updateUrl</b>(<i></i>) |
409 <b>updateUrl</b>(<i></i>) |
326 <p> |
410 <p> |
327 Public method to get the update URL of the script. |
411 Public method to get the update URL of the script. |
328 </p><dl> |
412 </p><dl> |