|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.WebBrowser.AdBlock.AdBlockRule</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.AdBlock.AdBlockRule</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the AdBlock rule class. |
|
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="#AdBlockRule">AdBlockRule</a></td> |
|
39 <td>Class implementing the AdBlock rule.</td> |
|
40 </tr> |
|
41 <tr> |
|
42 <td><a href="#AdBlockRuleOption">AdBlockRuleOption</a></td> |
|
43 <td>Class implementing the rule option enum.</td> |
|
44 </tr> |
|
45 <tr> |
|
46 <td><a href="#AdBlockRuleType">AdBlockRuleType</a></td> |
|
47 <td>Class implementing the rule type enum.</td> |
|
48 </tr> |
|
49 </table> |
|
50 <h3>Functions</h3> |
|
51 |
|
52 <table> |
|
53 |
|
54 <tr> |
|
55 <td><a href="#toSecondLevelDomain">toSecondLevelDomain</a></td> |
|
56 <td>Module function to get a second level domain from the given URL.</td> |
|
57 </tr> |
|
58 </table> |
|
59 <hr /> |
|
60 <hr /> |
|
61 <a NAME="AdBlockRule" ID="AdBlockRule"></a> |
|
62 <h2>AdBlockRule</h2> |
|
63 |
|
64 <p> |
|
65 Class implementing the AdBlock rule. |
|
66 </p> |
|
67 <h3>Derived from</h3> |
|
68 None |
|
69 <h3>Class Attributes</h3> |
|
70 |
|
71 <table> |
|
72 <tr><td>None</td></tr> |
|
73 </table> |
|
74 <h3>Class Methods</h3> |
|
75 |
|
76 <table> |
|
77 <tr><td>None</td></tr> |
|
78 </table> |
|
79 <h3>Methods</h3> |
|
80 |
|
81 <table> |
|
82 |
|
83 <tr> |
|
84 <td><a href="#AdBlockRule.__init__">AdBlockRule</a></td> |
|
85 <td>Constructor</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#AdBlockRule.__convertPatternToRegExp">__convertPatternToRegExp</a></td> |
|
89 <td>Private method to convert a wildcard pattern to a regular expression.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#AdBlockRule.__filterIsOnlyDomain">__filterIsOnlyDomain</a></td> |
|
93 <td>Private method to check, if the given filter is a domain only filter.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#AdBlockRule.__filterIsOnlyEndsMatch">__filterIsOnlyEndsMatch</a></td> |
|
97 <td>Private method to check, if the given filter is to match against the end of a string.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#AdBlockRule.__hasException">__hasException</a></td> |
|
101 <td>Private method to check, if the given option has been set as an exception.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#AdBlockRule.__hasOption">__hasOption</a></td> |
|
105 <td>Private method to check, if the given option has been set.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#AdBlockRule.__isMatchingDomain">__isMatchingDomain</a></td> |
|
109 <td>Private method to check, if a given domain matches the given filter string.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#AdBlockRule.__isMatchingRegExpStrings">__isMatchingRegExpStrings</a></td> |
|
113 <td>Private method to check the given URL against the fixed parts of the regexp.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#AdBlockRule.__parseDomains">__parseDomains</a></td> |
|
117 <td>Private method to parse a string with a domain list.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#AdBlockRule.__parseFilter">__parseFilter</a></td> |
|
121 <td>Private method to parse the filter pattern.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#AdBlockRule.__parseRegExpFilter">__parseRegExpFilter</a></td> |
|
125 <td>Private method to split the given regular expression into strings that can be used with 'in'.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#AdBlockRule.__setException">__setException</a></td> |
|
129 <td>Private method to set the given option as an exception.</td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><a href="#AdBlockRule.__stringMatch">__stringMatch</a></td> |
|
133 <td>Private method to match a domain string.</td> |
|
134 </tr> |
|
135 <tr> |
|
136 <td><a href="#AdBlockRule.addBlockedDomains">addBlockedDomains</a></td> |
|
137 <td>Public method to add to the list of blocked domains.</td> |
|
138 </tr> |
|
139 <tr> |
|
140 <td><a href="#AdBlockRule.allowedDomains">allowedDomains</a></td> |
|
141 <td>Public method to get a copy of the list of allowed domains.</td> |
|
142 </tr> |
|
143 <tr> |
|
144 <td><a href="#AdBlockRule.blockedDomains">blockedDomains</a></td> |
|
145 <td>Public method to get a copy of the list of blocked domains.</td> |
|
146 </tr> |
|
147 <tr> |
|
148 <td><a href="#AdBlockRule.caseSensitivity">caseSensitivity</a></td> |
|
149 <td>Public method to get the case sensitivity.</td> |
|
150 </tr> |
|
151 <tr> |
|
152 <td><a href="#AdBlockRule.copyFrom">copyFrom</a></td> |
|
153 <td>Public method to copy another AdBlock rule.</td> |
|
154 </tr> |
|
155 <tr> |
|
156 <td><a href="#AdBlockRule.cssSelector">cssSelector</a></td> |
|
157 <td>Public method to get the CSS selector of the rule.</td> |
|
158 </tr> |
|
159 <tr> |
|
160 <td><a href="#AdBlockRule.filter">filter</a></td> |
|
161 <td>Public method to get the rule filter string.</td> |
|
162 </tr> |
|
163 <tr> |
|
164 <td><a href="#AdBlockRule.getRegExpAndMatchers">getRegExpAndMatchers</a></td> |
|
165 <td>Public method to get the regular expression and associated string matchers.</td> |
|
166 </tr> |
|
167 <tr> |
|
168 <td><a href="#AdBlockRule.isCSSRule">isCSSRule</a></td> |
|
169 <td>Public method to check, if the rule is a CSS rule.</td> |
|
170 </tr> |
|
171 <tr> |
|
172 <td><a href="#AdBlockRule.isComment">isComment</a></td> |
|
173 <td>Public method to check, if this is a comment.</td> |
|
174 </tr> |
|
175 <tr> |
|
176 <td><a href="#AdBlockRule.isDocument">isDocument</a></td> |
|
177 <td>Public method to check, if this is a document rule.</td> |
|
178 </tr> |
|
179 <tr> |
|
180 <td><a href="#AdBlockRule.isDomainRestricted">isDomainRestricted</a></td> |
|
181 <td>Public method to check, if this rule is restricted by domain.</td> |
|
182 </tr> |
|
183 <tr> |
|
184 <td><a href="#AdBlockRule.isElementHiding">isElementHiding</a></td> |
|
185 <td>Public method to check, if this is an element hiding rule.</td> |
|
186 </tr> |
|
187 <tr> |
|
188 <td><a href="#AdBlockRule.isEnabled">isEnabled</a></td> |
|
189 <td>Public method to check, if the rule is enabled.</td> |
|
190 </tr> |
|
191 <tr> |
|
192 <td><a href="#AdBlockRule.isException">isException</a></td> |
|
193 <td>Public method to check, if the rule defines an exception.</td> |
|
194 </tr> |
|
195 <tr> |
|
196 <td><a href="#AdBlockRule.isHeader">isHeader</a></td> |
|
197 <td>Public method to check, if this is a header.</td> |
|
198 </tr> |
|
199 <tr> |
|
200 <td><a href="#AdBlockRule.isInternalDisabled">isInternalDisabled</a></td> |
|
201 <td>Public method to check, if this rule was disabled internally.</td> |
|
202 </tr> |
|
203 <tr> |
|
204 <td><a href="#AdBlockRule.isSlow">isSlow</a></td> |
|
205 <td>Public method to check, if this is a slow rule.</td> |
|
206 </tr> |
|
207 <tr> |
|
208 <td><a href="#AdBlockRule.matchDomain">matchDomain</a></td> |
|
209 <td>Public method to match a domain.</td> |
|
210 </tr> |
|
211 <tr> |
|
212 <td><a href="#AdBlockRule.matchFont">matchFont</a></td> |
|
213 <td>Public method to match a Font rule.</td> |
|
214 </tr> |
|
215 <tr> |
|
216 <td><a href="#AdBlockRule.matchImage">matchImage</a></td> |
|
217 <td>Public method to match an Image rule.</td> |
|
218 </tr> |
|
219 <tr> |
|
220 <td><a href="#AdBlockRule.matchMedia">matchMedia</a></td> |
|
221 <td>Public method to match a Media rule.</td> |
|
222 </tr> |
|
223 <tr> |
|
224 <td><a href="#AdBlockRule.matchObject">matchObject</a></td> |
|
225 <td>Public method to match an object rule.</td> |
|
226 </tr> |
|
227 <tr> |
|
228 <td><a href="#AdBlockRule.matchObjectSubrequest">matchObjectSubrequest</a></td> |
|
229 <td>Public method to match an Object Subrequest rule.</td> |
|
230 </tr> |
|
231 <tr> |
|
232 <td><a href="#AdBlockRule.matchOther">matchOther</a></td> |
|
233 <td>Public method to match any other rule.</td> |
|
234 </tr> |
|
235 <tr> |
|
236 <td><a href="#AdBlockRule.matchPing">matchPing</a></td> |
|
237 <td>Public method to match a Ping rule.</td> |
|
238 </tr> |
|
239 <tr> |
|
240 <td><a href="#AdBlockRule.matchScript">matchScript</a></td> |
|
241 <td>Public method to match a Script rule.</td> |
|
242 </tr> |
|
243 <tr> |
|
244 <td><a href="#AdBlockRule.matchString">matchString</a></td> |
|
245 <td>Public method to get the match string.</td> |
|
246 </tr> |
|
247 <tr> |
|
248 <td><a href="#AdBlockRule.matchStyleSheet">matchStyleSheet</a></td> |
|
249 <td>Public method to match a StyleSheet rule.</td> |
|
250 </tr> |
|
251 <tr> |
|
252 <td><a href="#AdBlockRule.matchSubdocument">matchSubdocument</a></td> |
|
253 <td>Public method to match a sub-document rule.</td> |
|
254 </tr> |
|
255 <tr> |
|
256 <td><a href="#AdBlockRule.matchThirdParty">matchThirdParty</a></td> |
|
257 <td>Public method to match a third-party rule.</td> |
|
258 </tr> |
|
259 <tr> |
|
260 <td><a href="#AdBlockRule.matchXmlHttpRequest">matchXmlHttpRequest</a></td> |
|
261 <td>Public method to match a XmlHttpRequest rule.</td> |
|
262 </tr> |
|
263 <tr> |
|
264 <td><a href="#AdBlockRule.networkMatch">networkMatch</a></td> |
|
265 <td>Public method to check the rule for a match.</td> |
|
266 </tr> |
|
267 <tr> |
|
268 <td><a href="#AdBlockRule.ruleExceptions">ruleExceptions</a></td> |
|
269 <td>Public method to get the rule exceptions.</td> |
|
270 </tr> |
|
271 <tr> |
|
272 <td><a href="#AdBlockRule.ruleOptions">ruleOptions</a></td> |
|
273 <td>Public method to get the rule options.</td> |
|
274 </tr> |
|
275 <tr> |
|
276 <td><a href="#AdBlockRule.ruleType">ruleType</a></td> |
|
277 <td>Public method to get the rule type.</td> |
|
278 </tr> |
|
279 <tr> |
|
280 <td><a href="#AdBlockRule.setEnabled">setEnabled</a></td> |
|
281 <td>Public method to set the rule's enabled state.</td> |
|
282 </tr> |
|
283 <tr> |
|
284 <td><a href="#AdBlockRule.setException">setException</a></td> |
|
285 <td>Public method to set the rule's exception flag.</td> |
|
286 </tr> |
|
287 <tr> |
|
288 <td><a href="#AdBlockRule.setFilter">setFilter</a></td> |
|
289 <td>Public method to set the rule filter string.</td> |
|
290 </tr> |
|
291 <tr> |
|
292 <td><a href="#AdBlockRule.setOption">setOption</a></td> |
|
293 <td>Public method to set the given option.</td> |
|
294 </tr> |
|
295 <tr> |
|
296 <td><a href="#AdBlockRule.setSubscription">setSubscription</a></td> |
|
297 <td>Public method to set the subscription this rule belongs to.</td> |
|
298 </tr> |
|
299 <tr> |
|
300 <td><a href="#AdBlockRule.subscription">subscription</a></td> |
|
301 <td>Public method to get the subscription this rule belongs to.</td> |
|
302 </tr> |
|
303 <tr> |
|
304 <td><a href="#AdBlockRule.urlMatch">urlMatch</a></td> |
|
305 <td>Public method to check an URL against the rule.</td> |
|
306 </tr> |
|
307 </table> |
|
308 <h3>Static Methods</h3> |
|
309 |
|
310 <table> |
|
311 <tr><td>None</td></tr> |
|
312 </table> |
|
313 |
|
314 <a NAME="AdBlockRule.__init__" ID="AdBlockRule.__init__"></a> |
|
315 <h4>AdBlockRule (Constructor)</h4> |
|
316 <b>AdBlockRule</b>(<i>filterRule="", subscription=None</i>) |
|
317 |
|
318 <p> |
|
319 Constructor |
|
320 </p> |
|
321 <dl> |
|
322 |
|
323 <dt><i>filterRule</i> (str)</dt> |
|
324 <dd> |
|
325 filter string of the rule |
|
326 </dd> |
|
327 <dt><i>subscription</i> (AdBlockSubscription)</dt> |
|
328 <dd> |
|
329 reference to the subscription object |
|
330 </dd> |
|
331 </dl> |
|
332 <a NAME="AdBlockRule.__convertPatternToRegExp" ID="AdBlockRule.__convertPatternToRegExp"></a> |
|
333 <h4>AdBlockRule.__convertPatternToRegExp</h4> |
|
334 <b>__convertPatternToRegExp</b>(<i>wildcardPattern</i>) |
|
335 |
|
336 <p> |
|
337 Private method to convert a wildcard pattern to a regular expression. |
|
338 </p> |
|
339 <dl> |
|
340 |
|
341 <dt><i>wildcardPattern</i> (str)</dt> |
|
342 <dd> |
|
343 string containing the wildcard pattern |
|
344 </dd> |
|
345 </dl> |
|
346 <dl> |
|
347 <dt>Return:</dt> |
|
348 <dd> |
|
349 string containing a regular expression |
|
350 </dd> |
|
351 </dl> |
|
352 <dl> |
|
353 <dt>Return Type:</dt> |
|
354 <dd> |
|
355 string |
|
356 </dd> |
|
357 </dl> |
|
358 <a NAME="AdBlockRule.__filterIsOnlyDomain" ID="AdBlockRule.__filterIsOnlyDomain"></a> |
|
359 <h4>AdBlockRule.__filterIsOnlyDomain</h4> |
|
360 <b>__filterIsOnlyDomain</b>(<i>filterString</i>) |
|
361 |
|
362 <p> |
|
363 Private method to check, if the given filter is a domain only filter. |
|
364 </p> |
|
365 <dl> |
|
366 |
|
367 <dt><i>filterString</i> (str)</dt> |
|
368 <dd> |
|
369 filter string to be checked |
|
370 </dd> |
|
371 </dl> |
|
372 <dl> |
|
373 <dt>Return:</dt> |
|
374 <dd> |
|
375 flag indicating a domain only filter |
|
376 </dd> |
|
377 </dl> |
|
378 <dl> |
|
379 <dt>Return Type:</dt> |
|
380 <dd> |
|
381 bool |
|
382 </dd> |
|
383 </dl> |
|
384 <a NAME="AdBlockRule.__filterIsOnlyEndsMatch" ID="AdBlockRule.__filterIsOnlyEndsMatch"></a> |
|
385 <h4>AdBlockRule.__filterIsOnlyEndsMatch</h4> |
|
386 <b>__filterIsOnlyEndsMatch</b>(<i>filterString</i>) |
|
387 |
|
388 <p> |
|
389 Private method to check, if the given filter is to match against the |
|
390 end of a string. |
|
391 </p> |
|
392 <dl> |
|
393 |
|
394 <dt><i>filterString</i> (str)</dt> |
|
395 <dd> |
|
396 filter string to be checked |
|
397 </dd> |
|
398 </dl> |
|
399 <dl> |
|
400 <dt>Return:</dt> |
|
401 <dd> |
|
402 flag indicating a end of string match filter |
|
403 </dd> |
|
404 </dl> |
|
405 <dl> |
|
406 <dt>Return Type:</dt> |
|
407 <dd> |
|
408 bool |
|
409 </dd> |
|
410 </dl> |
|
411 <a NAME="AdBlockRule.__hasException" ID="AdBlockRule.__hasException"></a> |
|
412 <h4>AdBlockRule.__hasException</h4> |
|
413 <b>__hasException</b>(<i>opt</i>) |
|
414 |
|
415 <p> |
|
416 Private method to check, if the given option has been set as an |
|
417 exception. |
|
418 </p> |
|
419 <dl> |
|
420 |
|
421 <dt><i>opt</i> (AdBlockRuleOption)</dt> |
|
422 <dd> |
|
423 option to check for |
|
424 </dd> |
|
425 </dl> |
|
426 <dl> |
|
427 <dt>Return:</dt> |
|
428 <dd> |
|
429 flag indicating the exception state of the option |
|
430 </dd> |
|
431 </dl> |
|
432 <dl> |
|
433 <dt>Return Type:</dt> |
|
434 <dd> |
|
435 bool |
|
436 </dd> |
|
437 </dl> |
|
438 <a NAME="AdBlockRule.__hasOption" ID="AdBlockRule.__hasOption"></a> |
|
439 <h4>AdBlockRule.__hasOption</h4> |
|
440 <b>__hasOption</b>(<i>opt</i>) |
|
441 |
|
442 <p> |
|
443 Private method to check, if the given option has been set. |
|
444 </p> |
|
445 <dl> |
|
446 |
|
447 <dt><i>opt</i> (AdBlockRuleOption)</dt> |
|
448 <dd> |
|
449 option to check for |
|
450 </dd> |
|
451 </dl> |
|
452 <dl> |
|
453 <dt>Return:</dt> |
|
454 <dd> |
|
455 flag indicating the state of the option |
|
456 </dd> |
|
457 </dl> |
|
458 <dl> |
|
459 <dt>Return Type:</dt> |
|
460 <dd> |
|
461 bool |
|
462 </dd> |
|
463 </dl> |
|
464 <a NAME="AdBlockRule.__isMatchingDomain" ID="AdBlockRule.__isMatchingDomain"></a> |
|
465 <h4>AdBlockRule.__isMatchingDomain</h4> |
|
466 <b>__isMatchingDomain</b>(<i>domain, filterString</i>) |
|
467 |
|
468 <p> |
|
469 Private method to check, if a given domain matches the given filter |
|
470 string. |
|
471 </p> |
|
472 <dl> |
|
473 |
|
474 <dt><i>domain</i> (str)</dt> |
|
475 <dd> |
|
476 domain to be checked |
|
477 </dd> |
|
478 <dt><i>filterString</i> (str)</dt> |
|
479 <dd> |
|
480 filter string to check against |
|
481 </dd> |
|
482 </dl> |
|
483 <dl> |
|
484 <dt>Return:</dt> |
|
485 <dd> |
|
486 flag indicating a match |
|
487 </dd> |
|
488 </dl> |
|
489 <dl> |
|
490 <dt>Return Type:</dt> |
|
491 <dd> |
|
492 bool |
|
493 </dd> |
|
494 </dl> |
|
495 <a NAME="AdBlockRule.__isMatchingRegExpStrings" ID="AdBlockRule.__isMatchingRegExpStrings"></a> |
|
496 <h4>AdBlockRule.__isMatchingRegExpStrings</h4> |
|
497 <b>__isMatchingRegExpStrings</b>(<i>url</i>) |
|
498 |
|
499 <p> |
|
500 Private method to check the given URL against the fixed parts of |
|
501 the regexp. |
|
502 </p> |
|
503 <dl> |
|
504 |
|
505 <dt><i>url</i> (str)</dt> |
|
506 <dd> |
|
507 URL to be checked |
|
508 </dd> |
|
509 </dl> |
|
510 <dl> |
|
511 <dt>Return:</dt> |
|
512 <dd> |
|
513 flag indicating a match |
|
514 </dd> |
|
515 </dl> |
|
516 <dl> |
|
517 <dt>Return Type:</dt> |
|
518 <dd> |
|
519 bool |
|
520 </dd> |
|
521 </dl> |
|
522 <a NAME="AdBlockRule.__parseDomains" ID="AdBlockRule.__parseDomains"></a> |
|
523 <h4>AdBlockRule.__parseDomains</h4> |
|
524 <b>__parseDomains</b>(<i>domains, separator</i>) |
|
525 |
|
526 <p> |
|
527 Private method to parse a string with a domain list. |
|
528 </p> |
|
529 <dl> |
|
530 |
|
531 <dt><i>domains</i> (str)</dt> |
|
532 <dd> |
|
533 list of domains |
|
534 </dd> |
|
535 <dt><i>separator</i> (str)</dt> |
|
536 <dd> |
|
537 separator character used by the list |
|
538 </dd> |
|
539 </dl> |
|
540 <a NAME="AdBlockRule.__parseFilter" ID="AdBlockRule.__parseFilter"></a> |
|
541 <h4>AdBlockRule.__parseFilter</h4> |
|
542 <b>__parseFilter</b>(<i></i>) |
|
543 |
|
544 <p> |
|
545 Private method to parse the filter pattern. |
|
546 </p> |
|
547 <a NAME="AdBlockRule.__parseRegExpFilter" ID="AdBlockRule.__parseRegExpFilter"></a> |
|
548 <h4>AdBlockRule.__parseRegExpFilter</h4> |
|
549 <b>__parseRegExpFilter</b>(<i>filterString</i>) |
|
550 |
|
551 <p> |
|
552 Private method to split the given regular expression into strings that |
|
553 can be used with 'in'. |
|
554 </p> |
|
555 <dl> |
|
556 |
|
557 <dt><i>filterString</i> (str)</dt> |
|
558 <dd> |
|
559 regexp filter string to be parsed |
|
560 </dd> |
|
561 </dl> |
|
562 <dl> |
|
563 <dt>Return:</dt> |
|
564 <dd> |
|
565 fixed string parts of the filter |
|
566 </dd> |
|
567 </dl> |
|
568 <dl> |
|
569 <dt>Return Type:</dt> |
|
570 <dd> |
|
571 list of str |
|
572 </dd> |
|
573 </dl> |
|
574 <a NAME="AdBlockRule.__setException" ID="AdBlockRule.__setException"></a> |
|
575 <h4>AdBlockRule.__setException</h4> |
|
576 <b>__setException</b>(<i>opt, on</i>) |
|
577 |
|
578 <p> |
|
579 Private method to set the given option as an exception. |
|
580 </p> |
|
581 <dl> |
|
582 |
|
583 <dt><i>opt</i> (AdBlockRuleOption)</dt> |
|
584 <dd> |
|
585 option to be set |
|
586 </dd> |
|
587 <dt><i>on</i> (bool)</dt> |
|
588 <dd> |
|
589 flag indicating to set or unset the exception |
|
590 </dd> |
|
591 </dl> |
|
592 <a NAME="AdBlockRule.__stringMatch" ID="AdBlockRule.__stringMatch"></a> |
|
593 <h4>AdBlockRule.__stringMatch</h4> |
|
594 <b>__stringMatch</b>(<i>domain, encodedUrl</i>) |
|
595 |
|
596 <p> |
|
597 Private method to match a domain string. |
|
598 </p> |
|
599 <dl> |
|
600 |
|
601 <dt><i>domain</i> (str)</dt> |
|
602 <dd> |
|
603 domain to match |
|
604 </dd> |
|
605 <dt><i>encodedUrl</i> (str)</dt> |
|
606 <dd> |
|
607 URL in encoded form |
|
608 </dd> |
|
609 </dl> |
|
610 <dl> |
|
611 <dt>Return:</dt> |
|
612 <dd> |
|
613 flag indicating a match |
|
614 </dd> |
|
615 </dl> |
|
616 <dl> |
|
617 <dt>Return Type:</dt> |
|
618 <dd> |
|
619 bool |
|
620 </dd> |
|
621 </dl> |
|
622 <a NAME="AdBlockRule.addBlockedDomains" ID="AdBlockRule.addBlockedDomains"></a> |
|
623 <h4>AdBlockRule.addBlockedDomains</h4> |
|
624 <b>addBlockedDomains</b>(<i>domains</i>) |
|
625 |
|
626 <p> |
|
627 Public method to add to the list of blocked domains. |
|
628 </p> |
|
629 <dl> |
|
630 |
|
631 <dt><i>domains</i> (str or list of str)</dt> |
|
632 <dd> |
|
633 list of domains to be added |
|
634 </dd> |
|
635 </dl> |
|
636 <a NAME="AdBlockRule.allowedDomains" ID="AdBlockRule.allowedDomains"></a> |
|
637 <h4>AdBlockRule.allowedDomains</h4> |
|
638 <b>allowedDomains</b>(<i></i>) |
|
639 |
|
640 <p> |
|
641 Public method to get a copy of the list of allowed domains. |
|
642 </p> |
|
643 <dl> |
|
644 <dt>Return:</dt> |
|
645 <dd> |
|
646 list of allowed domains |
|
647 </dd> |
|
648 </dl> |
|
649 <dl> |
|
650 <dt>Return Type:</dt> |
|
651 <dd> |
|
652 list of str |
|
653 </dd> |
|
654 </dl> |
|
655 <a NAME="AdBlockRule.blockedDomains" ID="AdBlockRule.blockedDomains"></a> |
|
656 <h4>AdBlockRule.blockedDomains</h4> |
|
657 <b>blockedDomains</b>(<i></i>) |
|
658 |
|
659 <p> |
|
660 Public method to get a copy of the list of blocked domains. |
|
661 </p> |
|
662 <dl> |
|
663 <dt>Return:</dt> |
|
664 <dd> |
|
665 list of blocked domains |
|
666 </dd> |
|
667 </dl> |
|
668 <dl> |
|
669 <dt>Return Type:</dt> |
|
670 <dd> |
|
671 list of str |
|
672 </dd> |
|
673 </dl> |
|
674 <a NAME="AdBlockRule.caseSensitivity" ID="AdBlockRule.caseSensitivity"></a> |
|
675 <h4>AdBlockRule.caseSensitivity</h4> |
|
676 <b>caseSensitivity</b>(<i></i>) |
|
677 |
|
678 <p> |
|
679 Public method to get the case sensitivity. |
|
680 </p> |
|
681 <dl> |
|
682 <dt>Return:</dt> |
|
683 <dd> |
|
684 case sensitivity |
|
685 </dd> |
|
686 </dl> |
|
687 <dl> |
|
688 <dt>Return Type:</dt> |
|
689 <dd> |
|
690 Qt.CaseSensitivity |
|
691 </dd> |
|
692 </dl> |
|
693 <a NAME="AdBlockRule.copyFrom" ID="AdBlockRule.copyFrom"></a> |
|
694 <h4>AdBlockRule.copyFrom</h4> |
|
695 <b>copyFrom</b>(<i>other</i>) |
|
696 |
|
697 <p> |
|
698 Public method to copy another AdBlock rule. |
|
699 </p> |
|
700 <dl> |
|
701 |
|
702 <dt><i>other</i> (AdBlockRule)</dt> |
|
703 <dd> |
|
704 reference to the AdBlock rule to copy from |
|
705 </dd> |
|
706 </dl> |
|
707 <a NAME="AdBlockRule.cssSelector" ID="AdBlockRule.cssSelector"></a> |
|
708 <h4>AdBlockRule.cssSelector</h4> |
|
709 <b>cssSelector</b>(<i></i>) |
|
710 |
|
711 <p> |
|
712 Public method to get the CSS selector of the rule. |
|
713 </p> |
|
714 <dl> |
|
715 <dt>Return:</dt> |
|
716 <dd> |
|
717 CSS selector |
|
718 </dd> |
|
719 </dl> |
|
720 <dl> |
|
721 <dt>Return Type:</dt> |
|
722 <dd> |
|
723 str |
|
724 </dd> |
|
725 </dl> |
|
726 <a NAME="AdBlockRule.filter" ID="AdBlockRule.filter"></a> |
|
727 <h4>AdBlockRule.filter</h4> |
|
728 <b>filter</b>(<i></i>) |
|
729 |
|
730 <p> |
|
731 Public method to get the rule filter string. |
|
732 </p> |
|
733 <dl> |
|
734 <dt>Return:</dt> |
|
735 <dd> |
|
736 rule filter string |
|
737 </dd> |
|
738 </dl> |
|
739 <dl> |
|
740 <dt>Return Type:</dt> |
|
741 <dd> |
|
742 str |
|
743 </dd> |
|
744 </dl> |
|
745 <a NAME="AdBlockRule.getRegExpAndMatchers" ID="AdBlockRule.getRegExpAndMatchers"></a> |
|
746 <h4>AdBlockRule.getRegExpAndMatchers</h4> |
|
747 <b>getRegExpAndMatchers</b>(<i></i>) |
|
748 |
|
749 <p> |
|
750 Public method to get the regular expression and associated string |
|
751 matchers. |
|
752 </p> |
|
753 <dl> |
|
754 <dt>Return:</dt> |
|
755 <dd> |
|
756 tuple containing the regular expression and the list of |
|
757 string matchers |
|
758 </dd> |
|
759 </dl> |
|
760 <dl> |
|
761 <dt>Return Type:</dt> |
|
762 <dd> |
|
763 tuple of (re.Pattern, list of str) |
|
764 </dd> |
|
765 </dl> |
|
766 <a NAME="AdBlockRule.isCSSRule" ID="AdBlockRule.isCSSRule"></a> |
|
767 <h4>AdBlockRule.isCSSRule</h4> |
|
768 <b>isCSSRule</b>(<i></i>) |
|
769 |
|
770 <p> |
|
771 Public method to check, if the rule is a CSS rule. |
|
772 </p> |
|
773 <dl> |
|
774 <dt>Return:</dt> |
|
775 <dd> |
|
776 flag indicating a CSS rule |
|
777 </dd> |
|
778 </dl> |
|
779 <dl> |
|
780 <dt>Return Type:</dt> |
|
781 <dd> |
|
782 bool |
|
783 </dd> |
|
784 </dl> |
|
785 <a NAME="AdBlockRule.isComment" ID="AdBlockRule.isComment"></a> |
|
786 <h4>AdBlockRule.isComment</h4> |
|
787 <b>isComment</b>(<i></i>) |
|
788 |
|
789 <p> |
|
790 Public method to check, if this is a comment. |
|
791 </p> |
|
792 <dl> |
|
793 <dt>Return:</dt> |
|
794 <dd> |
|
795 flag indicating a comment |
|
796 </dd> |
|
797 </dl> |
|
798 <dl> |
|
799 <dt>Return Type:</dt> |
|
800 <dd> |
|
801 bool |
|
802 </dd> |
|
803 </dl> |
|
804 <a NAME="AdBlockRule.isDocument" ID="AdBlockRule.isDocument"></a> |
|
805 <h4>AdBlockRule.isDocument</h4> |
|
806 <b>isDocument</b>(<i></i>) |
|
807 |
|
808 <p> |
|
809 Public method to check, if this is a document rule. |
|
810 </p> |
|
811 <dl> |
|
812 <dt>Return:</dt> |
|
813 <dd> |
|
814 flag indicating a document rule |
|
815 </dd> |
|
816 </dl> |
|
817 <dl> |
|
818 <dt>Return Type:</dt> |
|
819 <dd> |
|
820 bool |
|
821 </dd> |
|
822 </dl> |
|
823 <a NAME="AdBlockRule.isDomainRestricted" ID="AdBlockRule.isDomainRestricted"></a> |
|
824 <h4>AdBlockRule.isDomainRestricted</h4> |
|
825 <b>isDomainRestricted</b>(<i></i>) |
|
826 |
|
827 <p> |
|
828 Public method to check, if this rule is restricted by domain. |
|
829 </p> |
|
830 <dl> |
|
831 <dt>Return:</dt> |
|
832 <dd> |
|
833 flag indicating a domain restriction |
|
834 </dd> |
|
835 </dl> |
|
836 <dl> |
|
837 <dt>Return Type:</dt> |
|
838 <dd> |
|
839 bool |
|
840 </dd> |
|
841 </dl> |
|
842 <a NAME="AdBlockRule.isElementHiding" ID="AdBlockRule.isElementHiding"></a> |
|
843 <h4>AdBlockRule.isElementHiding</h4> |
|
844 <b>isElementHiding</b>(<i></i>) |
|
845 |
|
846 <p> |
|
847 Public method to check, if this is an element hiding rule. |
|
848 </p> |
|
849 <dl> |
|
850 <dt>Return:</dt> |
|
851 <dd> |
|
852 flag indicating an element hiding rule |
|
853 </dd> |
|
854 </dl> |
|
855 <dl> |
|
856 <dt>Return Type:</dt> |
|
857 <dd> |
|
858 bool |
|
859 </dd> |
|
860 </dl> |
|
861 <a NAME="AdBlockRule.isEnabled" ID="AdBlockRule.isEnabled"></a> |
|
862 <h4>AdBlockRule.isEnabled</h4> |
|
863 <b>isEnabled</b>(<i></i>) |
|
864 |
|
865 <p> |
|
866 Public method to check, if the rule is enabled. |
|
867 </p> |
|
868 <dl> |
|
869 <dt>Return:</dt> |
|
870 <dd> |
|
871 flag indicating enabled state |
|
872 </dd> |
|
873 </dl> |
|
874 <dl> |
|
875 <dt>Return Type:</dt> |
|
876 <dd> |
|
877 bool |
|
878 </dd> |
|
879 </dl> |
|
880 <a NAME="AdBlockRule.isException" ID="AdBlockRule.isException"></a> |
|
881 <h4>AdBlockRule.isException</h4> |
|
882 <b>isException</b>(<i></i>) |
|
883 |
|
884 <p> |
|
885 Public method to check, if the rule defines an exception. |
|
886 </p> |
|
887 <dl> |
|
888 <dt>Return:</dt> |
|
889 <dd> |
|
890 flag indicating an exception |
|
891 </dd> |
|
892 </dl> |
|
893 <dl> |
|
894 <dt>Return Type:</dt> |
|
895 <dd> |
|
896 bool |
|
897 </dd> |
|
898 </dl> |
|
899 <a NAME="AdBlockRule.isHeader" ID="AdBlockRule.isHeader"></a> |
|
900 <h4>AdBlockRule.isHeader</h4> |
|
901 <b>isHeader</b>(<i></i>) |
|
902 |
|
903 <p> |
|
904 Public method to check, if this is a header. |
|
905 </p> |
|
906 <dl> |
|
907 <dt>Return:</dt> |
|
908 <dd> |
|
909 flag indicating a header |
|
910 </dd> |
|
911 </dl> |
|
912 <dl> |
|
913 <dt>Return Type:</dt> |
|
914 <dd> |
|
915 bool |
|
916 </dd> |
|
917 </dl> |
|
918 <a NAME="AdBlockRule.isInternalDisabled" ID="AdBlockRule.isInternalDisabled"></a> |
|
919 <h4>AdBlockRule.isInternalDisabled</h4> |
|
920 <b>isInternalDisabled</b>(<i></i>) |
|
921 |
|
922 <p> |
|
923 Public method to check, if this rule was disabled internally. |
|
924 </p> |
|
925 <dl> |
|
926 <dt>Return:</dt> |
|
927 <dd> |
|
928 flag indicating an internally disabled rule |
|
929 </dd> |
|
930 </dl> |
|
931 <dl> |
|
932 <dt>Return Type:</dt> |
|
933 <dd> |
|
934 bool |
|
935 </dd> |
|
936 </dl> |
|
937 <a NAME="AdBlockRule.isSlow" ID="AdBlockRule.isSlow"></a> |
|
938 <h4>AdBlockRule.isSlow</h4> |
|
939 <b>isSlow</b>(<i></i>) |
|
940 |
|
941 <p> |
|
942 Public method to check, if this is a slow rule. |
|
943 </p> |
|
944 <dl> |
|
945 <dt>Return:</dt> |
|
946 <dd> |
|
947 flag indicating a slow rule |
|
948 </dd> |
|
949 </dl> |
|
950 <dl> |
|
951 <dt>Return Type:</dt> |
|
952 <dd> |
|
953 bool |
|
954 </dd> |
|
955 </dl> |
|
956 <a NAME="AdBlockRule.matchDomain" ID="AdBlockRule.matchDomain"></a> |
|
957 <h4>AdBlockRule.matchDomain</h4> |
|
958 <b>matchDomain</b>(<i>domain</i>) |
|
959 |
|
960 <p> |
|
961 Public method to match a domain. |
|
962 </p> |
|
963 <dl> |
|
964 |
|
965 <dt><i>domain</i> (str)</dt> |
|
966 <dd> |
|
967 domain name to check |
|
968 </dd> |
|
969 </dl> |
|
970 <dl> |
|
971 <dt>Return:</dt> |
|
972 <dd> |
|
973 flag indicating a match |
|
974 </dd> |
|
975 </dl> |
|
976 <dl> |
|
977 <dt>Return Type:</dt> |
|
978 <dd> |
|
979 bool |
|
980 </dd> |
|
981 </dl> |
|
982 <a NAME="AdBlockRule.matchFont" ID="AdBlockRule.matchFont"></a> |
|
983 <h4>AdBlockRule.matchFont</h4> |
|
984 <b>matchFont</b>(<i>req</i>) |
|
985 |
|
986 <p> |
|
987 Public method to match a Font rule. |
|
988 </p> |
|
989 <dl> |
|
990 |
|
991 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
992 <dd> |
|
993 request object to check |
|
994 </dd> |
|
995 </dl> |
|
996 <dl> |
|
997 <dt>Return:</dt> |
|
998 <dd> |
|
999 flag indicating a match |
|
1000 </dd> |
|
1001 </dl> |
|
1002 <dl> |
|
1003 <dt>Return Type:</dt> |
|
1004 <dd> |
|
1005 bool |
|
1006 </dd> |
|
1007 </dl> |
|
1008 <a NAME="AdBlockRule.matchImage" ID="AdBlockRule.matchImage"></a> |
|
1009 <h4>AdBlockRule.matchImage</h4> |
|
1010 <b>matchImage</b>(<i>req</i>) |
|
1011 |
|
1012 <p> |
|
1013 Public method to match an Image rule. |
|
1014 </p> |
|
1015 <dl> |
|
1016 |
|
1017 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1018 <dd> |
|
1019 request object to check |
|
1020 </dd> |
|
1021 </dl> |
|
1022 <dl> |
|
1023 <dt>Return:</dt> |
|
1024 <dd> |
|
1025 flag indicating a match |
|
1026 </dd> |
|
1027 </dl> |
|
1028 <dl> |
|
1029 <dt>Return Type:</dt> |
|
1030 <dd> |
|
1031 bool |
|
1032 </dd> |
|
1033 </dl> |
|
1034 <a NAME="AdBlockRule.matchMedia" ID="AdBlockRule.matchMedia"></a> |
|
1035 <h4>AdBlockRule.matchMedia</h4> |
|
1036 <b>matchMedia</b>(<i>req</i>) |
|
1037 |
|
1038 <p> |
|
1039 Public method to match a Media rule. |
|
1040 </p> |
|
1041 <dl> |
|
1042 |
|
1043 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1044 <dd> |
|
1045 request object to check |
|
1046 </dd> |
|
1047 </dl> |
|
1048 <dl> |
|
1049 <dt>Return:</dt> |
|
1050 <dd> |
|
1051 flag indicating a match |
|
1052 </dd> |
|
1053 </dl> |
|
1054 <dl> |
|
1055 <dt>Return Type:</dt> |
|
1056 <dd> |
|
1057 bool |
|
1058 </dd> |
|
1059 </dl> |
|
1060 <a NAME="AdBlockRule.matchObject" ID="AdBlockRule.matchObject"></a> |
|
1061 <h4>AdBlockRule.matchObject</h4> |
|
1062 <b>matchObject</b>(<i>req</i>) |
|
1063 |
|
1064 <p> |
|
1065 Public method to match an object rule. |
|
1066 </p> |
|
1067 <dl> |
|
1068 |
|
1069 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1070 <dd> |
|
1071 request object to check |
|
1072 </dd> |
|
1073 </dl> |
|
1074 <dl> |
|
1075 <dt>Return:</dt> |
|
1076 <dd> |
|
1077 flag indicating a match |
|
1078 </dd> |
|
1079 </dl> |
|
1080 <dl> |
|
1081 <dt>Return Type:</dt> |
|
1082 <dd> |
|
1083 bool |
|
1084 </dd> |
|
1085 </dl> |
|
1086 <a NAME="AdBlockRule.matchObjectSubrequest" ID="AdBlockRule.matchObjectSubrequest"></a> |
|
1087 <h4>AdBlockRule.matchObjectSubrequest</h4> |
|
1088 <b>matchObjectSubrequest</b>(<i>req</i>) |
|
1089 |
|
1090 <p> |
|
1091 Public method to match an Object Subrequest rule. |
|
1092 </p> |
|
1093 <dl> |
|
1094 |
|
1095 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1096 <dd> |
|
1097 request object to check |
|
1098 </dd> |
|
1099 </dl> |
|
1100 <dl> |
|
1101 <dt>Return:</dt> |
|
1102 <dd> |
|
1103 flag indicating a match |
|
1104 </dd> |
|
1105 </dl> |
|
1106 <dl> |
|
1107 <dt>Return Type:</dt> |
|
1108 <dd> |
|
1109 boolean |
|
1110 </dd> |
|
1111 </dl> |
|
1112 <a NAME="AdBlockRule.matchOther" ID="AdBlockRule.matchOther"></a> |
|
1113 <h4>AdBlockRule.matchOther</h4> |
|
1114 <b>matchOther</b>(<i>req</i>) |
|
1115 |
|
1116 <p> |
|
1117 Public method to match any other rule. |
|
1118 </p> |
|
1119 <dl> |
|
1120 |
|
1121 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1122 <dd> |
|
1123 request object to check |
|
1124 </dd> |
|
1125 </dl> |
|
1126 <dl> |
|
1127 <dt>Return:</dt> |
|
1128 <dd> |
|
1129 flag indicating a match |
|
1130 </dd> |
|
1131 </dl> |
|
1132 <dl> |
|
1133 <dt>Return Type:</dt> |
|
1134 <dd> |
|
1135 bool |
|
1136 </dd> |
|
1137 </dl> |
|
1138 <a NAME="AdBlockRule.matchPing" ID="AdBlockRule.matchPing"></a> |
|
1139 <h4>AdBlockRule.matchPing</h4> |
|
1140 <b>matchPing</b>(<i>req</i>) |
|
1141 |
|
1142 <p> |
|
1143 Public method to match a Ping rule. |
|
1144 </p> |
|
1145 <dl> |
|
1146 |
|
1147 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1148 <dd> |
|
1149 request object to check |
|
1150 </dd> |
|
1151 </dl> |
|
1152 <dl> |
|
1153 <dt>Return:</dt> |
|
1154 <dd> |
|
1155 flag indicating a match |
|
1156 </dd> |
|
1157 </dl> |
|
1158 <dl> |
|
1159 <dt>Return Type:</dt> |
|
1160 <dd> |
|
1161 bool |
|
1162 </dd> |
|
1163 </dl> |
|
1164 <a NAME="AdBlockRule.matchScript" ID="AdBlockRule.matchScript"></a> |
|
1165 <h4>AdBlockRule.matchScript</h4> |
|
1166 <b>matchScript</b>(<i>req</i>) |
|
1167 |
|
1168 <p> |
|
1169 Public method to match a Script rule. |
|
1170 </p> |
|
1171 <dl> |
|
1172 |
|
1173 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1174 <dd> |
|
1175 request object to check |
|
1176 </dd> |
|
1177 </dl> |
|
1178 <dl> |
|
1179 <dt>Return:</dt> |
|
1180 <dd> |
|
1181 flag indicating a match |
|
1182 </dd> |
|
1183 </dl> |
|
1184 <dl> |
|
1185 <dt>Return Type:</dt> |
|
1186 <dd> |
|
1187 bool |
|
1188 </dd> |
|
1189 </dl> |
|
1190 <a NAME="AdBlockRule.matchString" ID="AdBlockRule.matchString"></a> |
|
1191 <h4>AdBlockRule.matchString</h4> |
|
1192 <b>matchString</b>(<i></i>) |
|
1193 |
|
1194 <p> |
|
1195 Public method to get the match string. |
|
1196 </p> |
|
1197 <dl> |
|
1198 <dt>Return:</dt> |
|
1199 <dd> |
|
1200 match string |
|
1201 </dd> |
|
1202 </dl> |
|
1203 <dl> |
|
1204 <dt>Return Type:</dt> |
|
1205 <dd> |
|
1206 str |
|
1207 </dd> |
|
1208 </dl> |
|
1209 <a NAME="AdBlockRule.matchStyleSheet" ID="AdBlockRule.matchStyleSheet"></a> |
|
1210 <h4>AdBlockRule.matchStyleSheet</h4> |
|
1211 <b>matchStyleSheet</b>(<i>req</i>) |
|
1212 |
|
1213 <p> |
|
1214 Public method to match a StyleSheet rule. |
|
1215 </p> |
|
1216 <dl> |
|
1217 |
|
1218 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1219 <dd> |
|
1220 request object to check |
|
1221 </dd> |
|
1222 </dl> |
|
1223 <dl> |
|
1224 <dt>Return:</dt> |
|
1225 <dd> |
|
1226 flag indicating a match |
|
1227 </dd> |
|
1228 </dl> |
|
1229 <dl> |
|
1230 <dt>Return Type:</dt> |
|
1231 <dd> |
|
1232 bool |
|
1233 </dd> |
|
1234 </dl> |
|
1235 <a NAME="AdBlockRule.matchSubdocument" ID="AdBlockRule.matchSubdocument"></a> |
|
1236 <h4>AdBlockRule.matchSubdocument</h4> |
|
1237 <b>matchSubdocument</b>(<i>req</i>) |
|
1238 |
|
1239 <p> |
|
1240 Public method to match a sub-document rule. |
|
1241 </p> |
|
1242 <dl> |
|
1243 |
|
1244 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1245 <dd> |
|
1246 request object to check |
|
1247 </dd> |
|
1248 </dl> |
|
1249 <dl> |
|
1250 <dt>Return:</dt> |
|
1251 <dd> |
|
1252 flag indicating a match |
|
1253 </dd> |
|
1254 </dl> |
|
1255 <dl> |
|
1256 <dt>Return Type:</dt> |
|
1257 <dd> |
|
1258 boolean |
|
1259 </dd> |
|
1260 </dl> |
|
1261 <a NAME="AdBlockRule.matchThirdParty" ID="AdBlockRule.matchThirdParty"></a> |
|
1262 <h4>AdBlockRule.matchThirdParty</h4> |
|
1263 <b>matchThirdParty</b>(<i>req</i>) |
|
1264 |
|
1265 <p> |
|
1266 Public method to match a third-party rule. |
|
1267 </p> |
|
1268 <dl> |
|
1269 |
|
1270 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1271 <dd> |
|
1272 request object to check |
|
1273 </dd> |
|
1274 </dl> |
|
1275 <dl> |
|
1276 <dt>Return:</dt> |
|
1277 <dd> |
|
1278 flag indicating a match |
|
1279 </dd> |
|
1280 </dl> |
|
1281 <dl> |
|
1282 <dt>Return Type:</dt> |
|
1283 <dd> |
|
1284 boolean |
|
1285 </dd> |
|
1286 </dl> |
|
1287 <a NAME="AdBlockRule.matchXmlHttpRequest" ID="AdBlockRule.matchXmlHttpRequest"></a> |
|
1288 <h4>AdBlockRule.matchXmlHttpRequest</h4> |
|
1289 <b>matchXmlHttpRequest</b>(<i>req</i>) |
|
1290 |
|
1291 <p> |
|
1292 Public method to match a XmlHttpRequest rule. |
|
1293 </p> |
|
1294 <dl> |
|
1295 |
|
1296 <dt><i>req</i> (QWebEngineUrlRequestInfo)</dt> |
|
1297 <dd> |
|
1298 request object to check |
|
1299 </dd> |
|
1300 </dl> |
|
1301 <dl> |
|
1302 <dt>Return:</dt> |
|
1303 <dd> |
|
1304 flag indicating a match |
|
1305 </dd> |
|
1306 </dl> |
|
1307 <dl> |
|
1308 <dt>Return Type:</dt> |
|
1309 <dd> |
|
1310 bool |
|
1311 </dd> |
|
1312 </dl> |
|
1313 <a NAME="AdBlockRule.networkMatch" ID="AdBlockRule.networkMatch"></a> |
|
1314 <h4>AdBlockRule.networkMatch</h4> |
|
1315 <b>networkMatch</b>(<i>request, domain, encodedUrl</i>) |
|
1316 |
|
1317 <p> |
|
1318 Public method to check the rule for a match. |
|
1319 </p> |
|
1320 <dl> |
|
1321 |
|
1322 <dt><i>request</i> (QWebEngineUrlRequestInfo)</dt> |
|
1323 <dd> |
|
1324 reference to the network request |
|
1325 </dd> |
|
1326 <dt><i>domain</i> (str)</dt> |
|
1327 <dd> |
|
1328 domain name |
|
1329 </dd> |
|
1330 <dt><i>encodedUrl</i> (str)</dt> |
|
1331 <dd> |
|
1332 string encoded URL to be checked |
|
1333 </dd> |
|
1334 </dl> |
|
1335 <dl> |
|
1336 <dt>Return:</dt> |
|
1337 <dd> |
|
1338 flag indicating a match |
|
1339 </dd> |
|
1340 </dl> |
|
1341 <dl> |
|
1342 <dt>Return Type:</dt> |
|
1343 <dd> |
|
1344 bool |
|
1345 </dd> |
|
1346 </dl> |
|
1347 <a NAME="AdBlockRule.ruleExceptions" ID="AdBlockRule.ruleExceptions"></a> |
|
1348 <h4>AdBlockRule.ruleExceptions</h4> |
|
1349 <b>ruleExceptions</b>(<i></i>) |
|
1350 |
|
1351 <p> |
|
1352 Public method to get the rule exceptions. |
|
1353 </p> |
|
1354 <dl> |
|
1355 <dt>Return:</dt> |
|
1356 <dd> |
|
1357 rule exceptions |
|
1358 </dd> |
|
1359 </dl> |
|
1360 <dl> |
|
1361 <dt>Return Type:</dt> |
|
1362 <dd> |
|
1363 AdBlockRuleOption |
|
1364 </dd> |
|
1365 </dl> |
|
1366 <a NAME="AdBlockRule.ruleOptions" ID="AdBlockRule.ruleOptions"></a> |
|
1367 <h4>AdBlockRule.ruleOptions</h4> |
|
1368 <b>ruleOptions</b>(<i></i>) |
|
1369 |
|
1370 <p> |
|
1371 Public method to get the rule options. |
|
1372 </p> |
|
1373 <dl> |
|
1374 <dt>Return:</dt> |
|
1375 <dd> |
|
1376 rule options |
|
1377 </dd> |
|
1378 </dl> |
|
1379 <dl> |
|
1380 <dt>Return Type:</dt> |
|
1381 <dd> |
|
1382 AdBlockRuleOption |
|
1383 </dd> |
|
1384 </dl> |
|
1385 <a NAME="AdBlockRule.ruleType" ID="AdBlockRule.ruleType"></a> |
|
1386 <h4>AdBlockRule.ruleType</h4> |
|
1387 <b>ruleType</b>(<i></i>) |
|
1388 |
|
1389 <p> |
|
1390 Public method to get the rule type. |
|
1391 </p> |
|
1392 <dl> |
|
1393 <dt>Return:</dt> |
|
1394 <dd> |
|
1395 rule type |
|
1396 </dd> |
|
1397 </dl> |
|
1398 <dl> |
|
1399 <dt>Return Type:</dt> |
|
1400 <dd> |
|
1401 AdBlockRuleType |
|
1402 </dd> |
|
1403 </dl> |
|
1404 <a NAME="AdBlockRule.setEnabled" ID="AdBlockRule.setEnabled"></a> |
|
1405 <h4>AdBlockRule.setEnabled</h4> |
|
1406 <b>setEnabled</b>(<i>enabled</i>) |
|
1407 |
|
1408 <p> |
|
1409 Public method to set the rule's enabled state. |
|
1410 </p> |
|
1411 <dl> |
|
1412 |
|
1413 <dt><i>enabled</i> (bool)</dt> |
|
1414 <dd> |
|
1415 flag indicating the new enabled state |
|
1416 </dd> |
|
1417 </dl> |
|
1418 <a NAME="AdBlockRule.setException" ID="AdBlockRule.setException"></a> |
|
1419 <h4>AdBlockRule.setException</h4> |
|
1420 <b>setException</b>(<i>exception</i>) |
|
1421 |
|
1422 <p> |
|
1423 Public method to set the rule's exception flag. |
|
1424 </p> |
|
1425 <dl> |
|
1426 |
|
1427 <dt><i>exception</i> (bool)</dt> |
|
1428 <dd> |
|
1429 flag indicating an exception rule |
|
1430 </dd> |
|
1431 </dl> |
|
1432 <a NAME="AdBlockRule.setFilter" ID="AdBlockRule.setFilter"></a> |
|
1433 <h4>AdBlockRule.setFilter</h4> |
|
1434 <b>setFilter</b>(<i>filterRule</i>) |
|
1435 |
|
1436 <p> |
|
1437 Public method to set the rule filter string. |
|
1438 </p> |
|
1439 <dl> |
|
1440 |
|
1441 <dt><i>filterRule</i> (str)</dt> |
|
1442 <dd> |
|
1443 rule filter string |
|
1444 </dd> |
|
1445 </dl> |
|
1446 <a NAME="AdBlockRule.setOption" ID="AdBlockRule.setOption"></a> |
|
1447 <h4>AdBlockRule.setOption</h4> |
|
1448 <b>setOption</b>(<i>opt</i>) |
|
1449 |
|
1450 <p> |
|
1451 Public method to set the given option. |
|
1452 </p> |
|
1453 <dl> |
|
1454 |
|
1455 <dt><i>opt</i> (AdBlockRuleOption)</dt> |
|
1456 <dd> |
|
1457 option to be set |
|
1458 </dd> |
|
1459 </dl> |
|
1460 <a NAME="AdBlockRule.setSubscription" ID="AdBlockRule.setSubscription"></a> |
|
1461 <h4>AdBlockRule.setSubscription</h4> |
|
1462 <b>setSubscription</b>(<i>subscription</i>) |
|
1463 |
|
1464 <p> |
|
1465 Public method to set the subscription this rule belongs to. |
|
1466 </p> |
|
1467 <dl> |
|
1468 |
|
1469 <dt><i>subscription</i> (AdBlockSubscription)</dt> |
|
1470 <dd> |
|
1471 subscription of the rule |
|
1472 </dd> |
|
1473 </dl> |
|
1474 <a NAME="AdBlockRule.subscription" ID="AdBlockRule.subscription"></a> |
|
1475 <h4>AdBlockRule.subscription</h4> |
|
1476 <b>subscription</b>(<i></i>) |
|
1477 |
|
1478 <p> |
|
1479 Public method to get the subscription this rule belongs to. |
|
1480 </p> |
|
1481 <dl> |
|
1482 <dt>Return:</dt> |
|
1483 <dd> |
|
1484 subscription of the rule |
|
1485 </dd> |
|
1486 </dl> |
|
1487 <dl> |
|
1488 <dt>Return Type:</dt> |
|
1489 <dd> |
|
1490 AdBlockSubscription |
|
1491 </dd> |
|
1492 </dl> |
|
1493 <a NAME="AdBlockRule.urlMatch" ID="AdBlockRule.urlMatch"></a> |
|
1494 <h4>AdBlockRule.urlMatch</h4> |
|
1495 <b>urlMatch</b>(<i>url</i>) |
|
1496 |
|
1497 <p> |
|
1498 Public method to check an URL against the rule. |
|
1499 </p> |
|
1500 <dl> |
|
1501 |
|
1502 <dt><i>url</i> (QUrl)</dt> |
|
1503 <dd> |
|
1504 URL to check |
|
1505 </dd> |
|
1506 </dl> |
|
1507 <dl> |
|
1508 <dt>Return:</dt> |
|
1509 <dd> |
|
1510 flag indicating a match |
|
1511 </dd> |
|
1512 </dl> |
|
1513 <dl> |
|
1514 <dt>Return Type:</dt> |
|
1515 <dd> |
|
1516 bool |
|
1517 </dd> |
|
1518 </dl> |
|
1519 <div align="right"><a href="#top">Up</a></div> |
|
1520 <hr /> |
|
1521 <hr /> |
|
1522 <a NAME="AdBlockRuleOption" ID="AdBlockRuleOption"></a> |
|
1523 <h2>AdBlockRuleOption</h2> |
|
1524 |
|
1525 <p> |
|
1526 Class implementing the rule option enum. |
|
1527 </p> |
|
1528 <h3>Derived from</h3> |
|
1529 IntEnum |
|
1530 <h3>Class Attributes</h3> |
|
1531 |
|
1532 <table> |
|
1533 <tr><td>DocumentOption</td></tr><tr><td>DomainRestrictedOption</td></tr><tr><td>ElementHideOption</td></tr><tr><td>FontOption</td></tr><tr><td>ImageOption</td></tr><tr><td>MediaOption</td></tr><tr><td>NoOption</td></tr><tr><td>ObjectOption</td></tr><tr><td>ObjectSubrequestOption</td></tr><tr><td>OtherOption</td></tr><tr><td>PingOption</td></tr><tr><td>ScriptOption</td></tr><tr><td>StyleSheetOption</td></tr><tr><td>SubdocumentOption</td></tr><tr><td>ThirdPartyOption</td></tr><tr><td>XMLHttpRequestOption</td></tr> |
|
1534 </table> |
|
1535 <h3>Class Methods</h3> |
|
1536 |
|
1537 <table> |
|
1538 <tr><td>None</td></tr> |
|
1539 </table> |
|
1540 <h3>Methods</h3> |
|
1541 |
|
1542 <table> |
|
1543 <tr><td>None</td></tr> |
|
1544 </table> |
|
1545 <h3>Static Methods</h3> |
|
1546 |
|
1547 <table> |
|
1548 <tr><td>None</td></tr> |
|
1549 </table> |
|
1550 |
|
1551 <div align="right"><a href="#top">Up</a></div> |
|
1552 <hr /> |
|
1553 <hr /> |
|
1554 <a NAME="AdBlockRuleType" ID="AdBlockRuleType"></a> |
|
1555 <h2>AdBlockRuleType</h2> |
|
1556 |
|
1557 <p> |
|
1558 Class implementing the rule type enum. |
|
1559 </p> |
|
1560 <h3>Derived from</h3> |
|
1561 IntEnum |
|
1562 <h3>Class Attributes</h3> |
|
1563 |
|
1564 <table> |
|
1565 <tr><td>CssRule</td></tr><tr><td>DomainMatchRule</td></tr><tr><td>Invalid</td></tr><tr><td>MatchAllUrlsRule</td></tr><tr><td>RegExpMatchRule</td></tr><tr><td>StringContainsMatchRule</td></tr><tr><td>StringEndsMatchRule</td></tr> |
|
1566 </table> |
|
1567 <h3>Class Methods</h3> |
|
1568 |
|
1569 <table> |
|
1570 <tr><td>None</td></tr> |
|
1571 </table> |
|
1572 <h3>Methods</h3> |
|
1573 |
|
1574 <table> |
|
1575 <tr><td>None</td></tr> |
|
1576 </table> |
|
1577 <h3>Static Methods</h3> |
|
1578 |
|
1579 <table> |
|
1580 <tr><td>None</td></tr> |
|
1581 </table> |
|
1582 |
|
1583 <div align="right"><a href="#top">Up</a></div> |
|
1584 <hr /> |
|
1585 <hr /> |
|
1586 <a NAME="toSecondLevelDomain" ID="toSecondLevelDomain"></a> |
|
1587 <h2>toSecondLevelDomain</h2> |
|
1588 <b>toSecondLevelDomain</b>(<i>url</i>) |
|
1589 |
|
1590 <p> |
|
1591 Module function to get a second level domain from the given URL. |
|
1592 </p> |
|
1593 <dl> |
|
1594 |
|
1595 <dt><i>url</i> (QUrl)</dt> |
|
1596 <dd> |
|
1597 URL to extract domain from |
|
1598 </dd> |
|
1599 </dl> |
|
1600 <dl> |
|
1601 <dt>Return:</dt> |
|
1602 <dd> |
|
1603 name of second level domain |
|
1604 </dd> |
|
1605 </dl> |
|
1606 <dl> |
|
1607 <dt>Return Type:</dt> |
|
1608 <dd> |
|
1609 str |
|
1610 </dd> |
|
1611 </dl> |
|
1612 <div align="right"><a href="#top">Up</a></div> |
|
1613 <hr /> |
|
1614 </body></html> |