OLD | NEW |
1 title=Writing Adblock Plus filters | 1 title=Writing Adblock Plus filters |
2 | 2 |
3 | 3 |
4 <p>{{s1 Current Adblock Plus versions allow you to "tweak" your filters in many
different ways. This document explains the choices that you have and how they ca
n be used.}}</p> | 4 <p>{{s1 Current Adblock Plus versions allow you to "tweak" your filters in many
different ways. This document explains the choices that you have and how they ca
n be used.}}</p> |
5 | 5 |
6 <p>{{s2 <em>Disclaimer</em>: All filter examples given here are really only ex
amples and are not meant to be used.}}</p> | 6 <p>{{s2 <em>Disclaimer</em>: All filter examples given here are really only ex
amples and are not meant to be used.}}</p> |
7 | 7 |
8 <h2 id="introduction">{{s3 Introduction to Adblock Plus filters}}</h2> | 8 <h2 id="introduction">{{s3 Introduction to Adblock Plus filters}}</h2> |
9 | 9 |
10 <p>{{s4 The options described in this section should be enough for users who h
ave to create a filter occasionally.}}</p> | 10 <p>{{s4 The options described in this section should be enough for users who h
ave to create a filter occasionally.}}</p> |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 <li>{{xmlhttprequest <code><fix>xmlhttprequest</fix></code> — requests s
tarted using the <a href="https://xhr.spec.whatwg.org/"><code><fix>XMLHttpReques
t</fix></code> object</a> or <a href="https://fetch.spec.whatwg.org/"><code><fix
>fetch()</fix></code> API</a>}}</li> | 150 <li>{{xmlhttprequest <code><fix>xmlhttprequest</fix></code> — requests s
tarted using the <a href="https://xhr.spec.whatwg.org/"><code><fix>XMLHttpReques
t</fix></code> object</a> or <a href="https://fetch.spec.whatwg.org/"><code><fix
>fetch()</fix></code> API</a>}}</li> |
151 <li>{{s63 <code><fix>object-subrequest</fix></code> — requests started b
y plugins like Flash}}</li> | 151 <li>{{s63 <code><fix>object-subrequest</fix></code> — requests started b
y plugins like Flash}}</li> |
152 <li>{{s64 <code><fix>subdocument</fix></code> — embedded pages, usually
included via HTML frames}}</li> | 152 <li>{{s64 <code><fix>subdocument</fix></code> — embedded pages, usually
included via HTML frames}}</li> |
153 <li>{{ping <code><fix>ping</fix></code> — requests started by <a href="h
ttps://developer.mozilla.org/docs/Web/HTML/Element/a#attr-ping"><code><fix><a
ping></fix></code></a> or <a href="https://developer.mozilla.org/docs/Web/AP
I/Navigator/sendBeacon"><code><fix>navigator.sendBeacon()</fix></code></a> (Adbl
ock Plus 2.7.1 or higher required)}}</li> | 153 <li>{{ping <code><fix>ping</fix></code> — requests started by <a href="h
ttps://developer.mozilla.org/docs/Web/HTML/Element/a#attr-ping"><code><fix><a
ping></fix></code></a> or <a href="https://developer.mozilla.org/docs/Web/AP
I/Navigator/sendBeacon"><code><fix>navigator.sendBeacon()</fix></code></a> (Adbl
ock Plus 2.7.1 or higher required)}}</li> |
154 <li>{{websocket <code><fix>websocket</fix></code> — requests initiated v
ia <a href="https://developer.mozilla.org/docs/Web/API/WebSocket"><code><fix>Web
Socket</fix></code> object</a> (Adblock Plus 2.8 or higher required)}}</li> | 154 <li>{{websocket <code><fix>websocket</fix></code> — requests initiated v
ia <a href="https://developer.mozilla.org/docs/Web/API/WebSocket"><code><fix>Web
Socket</fix></code> object</a> (Adblock Plus 2.8 or higher required)}}</li> |
155 <li>{{webrtc <code><fix>webrtc</fix></code> — connections opened via <a
href="https://developer.mozilla.org/docs/Web/API/RTCPeerConnection"><code><fix>R
TCPeerConnection</fix></code> instances</a> to ICE servers (Adblock Plus for Chr
ome and Opera 1.13.3 or higher required, Adblock Plus for Firefox and Safari not
yet supported)}}</li> | 155 <li>{{webrtc <code><fix>webrtc</fix></code> — connections opened via <a
href="https://developer.mozilla.org/docs/Web/API/RTCPeerConnection"><code><fix>R
TCPeerConnection</fix></code> instances</a> to ICE servers (Adblock Plus for Chr
ome and Opera 1.13.3 or higher required, Adblock Plus for Firefox and Safari not
yet supported)}}</li> |
156 <li>{{s65 <code><fix>document</fix></code> — the page itself (only <a hr
ef="#whitelist">exception rules</a> can be applied to the page)}}</li> | 156 <li>{{s65 <code><fix>document</fix></code> — the page itself (only <a hr
ef="#whitelist">exception rules</a> can be applied to the page)}}</li> |
157 <li>{{s66 <code><fix>elemhide</fix></code> — for exception rules only, s
imilar to <code><fix>document</fix></code> but only disables <a href="#elemhide"
>element hiding rules</a> on the page rather than all filter rules (Adblock Plus
1.2 or higher required)}}</li> | 157 <li>{{s66 <code><fix>elemhide</fix></code> — for exception rules only, s
imilar to <code><fix>document</fix></code> but only disables <a href="#elemhide"
>element hiding rules</a> on the page rather than all filter rules (Adblock Plus
1.2 or higher required)}}</li> |
158 <li>{{generichide <code><fix>generichide</fix></code> — for exception ru
les only, similar to <code><fix>elemhide</fix></code> but only disables <a href=
"#generic-specific">generic</a> element hiding rules on the page (Adblock Plus 2
.6.12 or higher required)}}</li> | 158 <li>{{generichide <code><fix>generichide</fix></code> — for exception ru
les only, similar to <code><fix>elemhide</fix></code> but only disables <a href=
"#generic-specific">generic</a> element hiding rules on the page (Adblock Plus 2
.6.12 or higher required)}}</li> |
159 <li>{{genericblock <code><fix>genericblock</fix></code> — for exception
rules only, just like <code><fix>generichide</fix></code> but disables <a href="
#generic-specific">generic</a> blocking rules (Adblock Plus 2.6.12 or higher req
uired)}}</li> | 159 <li>{{genericblock <code><fix>genericblock</fix></code> — for exception
rules only, just like <code><fix>generichide</fix></code> but disables <a href="
#generic-specific">generic</a> blocking rules (Adblock Plus 2.6.12 or higher req
uired)}}</li> |
| 160 <li>{{popup <code><fix>$popup</fix></code> — pages opened in a new tab o
r window}}</li> |
160 <li>{{s67 <code><fix>other</fix></code> — types of requests not covered
in the list above}}</li> | 161 <li>{{s67 <code><fix>other</fix></code> — types of requests not covered
in the list above}}</li> |
161 </ul> | 162 </ul> |
162 {{deprecated-options The type options <code><fix>background</fix></code>, | 163 {{deprecated-options The type options <code><fix>background</fix></code>, |
163 <code><fix>xbl</fix></code> and <code><fix>dtd</fix></code> are outdated | 164 <code><fix>xbl</fix></code> and <code><fix>dtd</fix></code> are outdated |
164 and should no longer be used.}} | 165 and should no longer be used.}} |
165 </li> | 166 </li> |
166 <li>{{s69 Inverse type options: specify the element types the filter should
<strong>not</strong> be applied to. Possible inverse type options: <code><fix>~s
cript</fix></code>, <code><fix>~image</fix></code>, <code><fix>~stylesheet</fix>
</code>, <code><fix>~object</fix></code>, <code><fix>~xmlhttprequest</fix></code
>, <code><fix>~object-subrequest</fix></code>, <code><fix>~subdocument</fix></co
de>, <code><fix>~document</fix></code>, <code><fix>~elemhide</fix></code>, <code
><fix>~other</fix></code>}}</li> | 167 <li>{{s69 Inverse type options: specify the element types the filter should
<strong>not</strong> be applied to. Possible inverse type options: <code><fix>~s
cript</fix></code>, <code><fix>~image</fix></code>, <code><fix>~stylesheet</fix>
</code>, <code><fix>~object</fix></code>, <code><fix>~xmlhttprequest</fix></code
>, <code><fix>~object-subrequest</fix></code>, <code><fix>~subdocument</fix></co
de>, <code><fix>~document</fix></code>, <code><fix>~elemhide</fix></code>, <code
><fix>~other</fix></code>}}</li> |
167 <li>{{s70 Restriction to third-party/first-party requests: If the <code><fix
>third-party</fix></code> option is specified, the filter is only applied to req
uests from a different origin than the currently viewed page. Similarly, <code><
fix>~third-party</fix></code> restricts the filter to requests from the same ori
gin as the currently viewed page.}}</li> | 168 <li>{{s70 Restriction to third-party/first-party requests: If the <code><fix
>third-party</fix></code> option is specified, the filter is only applied to req
uests from a different origin than the currently viewed page. Similarly, <code><
fix>~third-party</fix></code> restricts the filter to requests from the same ori
gin as the currently viewed page.}}</li> |
168 <li>{{s71 Domain restrictions: The option <code><fix>domain=example.com</fix
></code> means that the filter should only be applied on pages from "example.com
" domain. Multiple domains can be specified using "|" as separator: with the opt
ion <code><fix>domain=example.com|example.net</fix></code> the filter will only
be applied on pages from "example.com" or "example.net" domains. If a domain nam
e is preceded with "~", the filter should <strong>not</strong> be applied on pag
es from this domain. For example, <code><fix>domain=~example.com</fix></code> me
ans that the filter should be applied on pages from any domain but "example.com"
and <code><fix>domain=example.com|~foo.example.com</fix></code> restricts the f
ilter to the "example.com" domain with the exception of "foo.example.com" subdom
ain.}}</li> | 169 <li>{{s71 Domain restrictions: The option <code><fix>domain=example.com</fix
></code> means that the filter should only be applied on pages from "example.com
" domain. Multiple domains can be specified using "|" as separator: with the opt
ion <code><fix>domain=example.com|example.net</fix></code> the filter will only
be applied on pages from "example.com" or "example.net" domains. If a domain nam
e is preceded with "~", the filter should <strong>not</strong> be applied on pag
es from this domain. For example, <code><fix>domain=~example.com</fix></code> me
ans that the filter should be applied on pages from any domain but "example.com"
and <code><fix>domain=example.com|~foo.example.com</fix></code> restricts the f
ilter to the "example.com" domain with the exception of "foo.example.com" subdom
ain.}}</li> |
169 <li> | 170 <li> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 {{s110 The data used for creating the signature is a concatenated list of requ
est variables (namely URI, host and user agent) separated by the <code><fix>NUL<
/fix></code> character "\0". For example:}} | 272 {{s110 The data used for creating the signature is a concatenated list of requ
est variables (namely URI, host and user agent) separated by the <code><fix>NUL<
/fix></code> character "\0". For example:}} |
272 </p> | 273 </p> |
273 | 274 |
274 <pre> | 275 <pre> |
275 /index.html?q=foo\0www.example.com\0Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv
:30.0) Gecko/20100101 Firefox/30.0 | 276 /index.html?q=foo\0www.example.com\0Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv
:30.0) Gecko/20100101 Firefox/30.0 |
276 </pre> | 277 </pre> |
277 | 278 |
278 <p> | 279 <p> |
279 {{s111 Finally, generate the signature for this string by using the signature
algorithm SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE (default when using OpenSSL).}} | 280 {{s111 Finally, generate the signature for this string by using the signature
algorithm SEC_OID_ISO_SHA_WITH_RSA_SIGNATURE (default when using OpenSSL).}} |
280 </p> | 281 </p> |
OLD | NEW |