|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.WebBrowser.AdBlock.AdBlockMatcher</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.WebBrowser.AdBlock.AdBlockMatcher</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the AdBlock matcher. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#AdBlockMatcher">AdBlockMatcher</a></td> |
|
25 <td>Class implementing the AdBlock matcher.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="AdBlockMatcher" ID="AdBlockMatcher"></a> |
|
36 <h2>AdBlockMatcher</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing the AdBlock matcher. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 QObject |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>None</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#AdBlockMatcher.__init__">AdBlockMatcher</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#AdBlockMatcher.adBlockDisabledForUrl">adBlockDisabledForUrl</a></td> |
|
63 <td>Public method to check, if AdBlock is disabled for the given URL.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#AdBlockMatcher.clear">clear</a></td> |
|
67 <td>Public slot to clear the internal structures.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#AdBlockMatcher.elemHideDisabledForUrl">elemHideDisabledForUrl</a></td> |
|
71 <td>Public method to check, if element hiding is disabled for the given URL.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#AdBlockMatcher.elementHidingRules">elementHidingRules</a></td> |
|
75 <td>Public method to get the element hiding rules.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#AdBlockMatcher.elementHidingRulesForDomain">elementHidingRulesForDomain</a></td> |
|
79 <td>Public method to get the element hiding rules for the given domain.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#AdBlockMatcher.match">match</a></td> |
|
83 <td>Public method to match a request.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#AdBlockMatcher.update">update</a></td> |
|
87 <td>Public slot to update the internal state.</td> |
|
88 </tr> |
|
89 </table> |
|
90 <h3>Static Methods</h3> |
|
91 |
|
92 <table> |
|
93 <tr><td>None</td></tr> |
|
94 </table> |
|
95 |
|
96 <a NAME="AdBlockMatcher.__init__" ID="AdBlockMatcher.__init__"></a> |
|
97 <h4>AdBlockMatcher (Constructor)</h4> |
|
98 <b>AdBlockMatcher</b>(<i>manager</i>) |
|
99 |
|
100 <p> |
|
101 Constructor |
|
102 </p> |
|
103 <dl> |
|
104 |
|
105 <dt><i>manager</i> (AdBlockManager)</dt> |
|
106 <dd> |
|
107 reference to the AdBlock manager object |
|
108 </dd> |
|
109 </dl> |
|
110 <a NAME="AdBlockMatcher.adBlockDisabledForUrl" ID="AdBlockMatcher.adBlockDisabledForUrl"></a> |
|
111 <h4>AdBlockMatcher.adBlockDisabledForUrl</h4> |
|
112 <b>adBlockDisabledForUrl</b>(<i>url</i>) |
|
113 |
|
114 <p> |
|
115 Public method to check, if AdBlock is disabled for the given URL. |
|
116 </p> |
|
117 <dl> |
|
118 |
|
119 <dt><i>url</i> (QUrl)</dt> |
|
120 <dd> |
|
121 URL to check |
|
122 </dd> |
|
123 </dl> |
|
124 <dl> |
|
125 <dt>Return:</dt> |
|
126 <dd> |
|
127 flag indicating disabled state |
|
128 </dd> |
|
129 </dl> |
|
130 <dl> |
|
131 <dt>Return Type:</dt> |
|
132 <dd> |
|
133 bool |
|
134 </dd> |
|
135 </dl> |
|
136 <a NAME="AdBlockMatcher.clear" ID="AdBlockMatcher.clear"></a> |
|
137 <h4>AdBlockMatcher.clear</h4> |
|
138 <b>clear</b>(<i></i>) |
|
139 |
|
140 <p> |
|
141 Public slot to clear the internal structures. |
|
142 </p> |
|
143 <a NAME="AdBlockMatcher.elemHideDisabledForUrl" ID="AdBlockMatcher.elemHideDisabledForUrl"></a> |
|
144 <h4>AdBlockMatcher.elemHideDisabledForUrl</h4> |
|
145 <b>elemHideDisabledForUrl</b>(<i>url</i>) |
|
146 |
|
147 <p> |
|
148 Public method to check, if element hiding is disabled for the given |
|
149 URL. |
|
150 </p> |
|
151 <dl> |
|
152 |
|
153 <dt><i>url</i> (QUrl)</dt> |
|
154 <dd> |
|
155 URL to check |
|
156 </dd> |
|
157 </dl> |
|
158 <dl> |
|
159 <dt>Return:</dt> |
|
160 <dd> |
|
161 flag indicating disabled state |
|
162 </dd> |
|
163 </dl> |
|
164 <dl> |
|
165 <dt>Return Type:</dt> |
|
166 <dd> |
|
167 bool |
|
168 </dd> |
|
169 </dl> |
|
170 <a NAME="AdBlockMatcher.elementHidingRules" ID="AdBlockMatcher.elementHidingRules"></a> |
|
171 <h4>AdBlockMatcher.elementHidingRules</h4> |
|
172 <b>elementHidingRules</b>(<i></i>) |
|
173 |
|
174 <p> |
|
175 Public method to get the element hiding rules. |
|
176 </p> |
|
177 <dl> |
|
178 <dt>Return:</dt> |
|
179 <dd> |
|
180 element hiding rules |
|
181 </dd> |
|
182 </dl> |
|
183 <dl> |
|
184 <dt>Return Type:</dt> |
|
185 <dd> |
|
186 str |
|
187 </dd> |
|
188 </dl> |
|
189 <a NAME="AdBlockMatcher.elementHidingRulesForDomain" ID="AdBlockMatcher.elementHidingRulesForDomain"></a> |
|
190 <h4>AdBlockMatcher.elementHidingRulesForDomain</h4> |
|
191 <b>elementHidingRulesForDomain</b>(<i>domain</i>) |
|
192 |
|
193 <p> |
|
194 Public method to get the element hiding rules for the given domain. |
|
195 </p> |
|
196 <dl> |
|
197 |
|
198 <dt><i>domain</i> (str)</dt> |
|
199 <dd> |
|
200 domain name |
|
201 </dd> |
|
202 </dl> |
|
203 <dl> |
|
204 <dt>Return:</dt> |
|
205 <dd> |
|
206 element hiding rules |
|
207 </dd> |
|
208 </dl> |
|
209 <dl> |
|
210 <dt>Return Type:</dt> |
|
211 <dd> |
|
212 str |
|
213 </dd> |
|
214 </dl> |
|
215 <a NAME="AdBlockMatcher.match" ID="AdBlockMatcher.match"></a> |
|
216 <h4>AdBlockMatcher.match</h4> |
|
217 <b>match</b>(<i>request, urlDomain, urlString</i>) |
|
218 |
|
219 <p> |
|
220 Public method to match a request. |
|
221 </p> |
|
222 <dl> |
|
223 |
|
224 <dt><i>request</i> (QWebEngineUrlRequestInfo)</dt> |
|
225 <dd> |
|
226 URL request to be matched |
|
227 </dd> |
|
228 <dt><i>urlDomain</i> (str)</dt> |
|
229 <dd> |
|
230 domain of the URL |
|
231 </dd> |
|
232 <dt><i>urlString</i> (str)</dt> |
|
233 <dd> |
|
234 requested URL as a lowercase string |
|
235 </dd> |
|
236 </dl> |
|
237 <dl> |
|
238 <dt>Return:</dt> |
|
239 <dd> |
|
240 reference to the matched rule |
|
241 </dd> |
|
242 </dl> |
|
243 <dl> |
|
244 <dt>Return Type:</dt> |
|
245 <dd> |
|
246 AdBlockRule |
|
247 </dd> |
|
248 </dl> |
|
249 <a NAME="AdBlockMatcher.update" ID="AdBlockMatcher.update"></a> |
|
250 <h4>AdBlockMatcher.update</h4> |
|
251 <b>update</b>(<i></i>) |
|
252 |
|
253 <p> |
|
254 Public slot to update the internal state. |
|
255 </p> |
|
256 <div align="right"><a href="#top">Up</a></div> |
|
257 <hr /> |
|
258 </body></html> |