Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: locales/en/faq_internal.json

Issue 6021528219025408: Issue #1170 More progress migrating adblockplus.org to our CMS. (Closed)
Patch Set: Created Sept. 1, 2014, 10:45 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « locales/en/faq_install.json ('k') | locales/en/faq_project.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 { 1 {
2 "title": { 2 "title": {
3 "message": "FAQ - Adblock Plus internals" 3 "message": "FAQ - Adblock Plus internals"
4 }, 4 },
5 "s1": { 5 "s1": {
6 "message": "Where do I find the meaning of all Adblock Plus preferences?" 6 "message": "Where do I find the meaning of all Adblock Plus preferences?"
7 }, 7 },
8 "s2": { 8 "s2": {
9 "message": "Adblock Plus uses a number of preferences that are accessible vi a" 9 "message": "Adblock Plus uses a number of preferences that are accessible vi a <a>about:config</a>. All of them start with"
10 }, 10 },
11 "s3": { 11 "s3": {
12 "message": "http://kb.mozillazine.org/About:config" 12 "message": "extensions.adblockplus."
13 }, 13 },
14 "s4": { 14 "s4": {
15 "message": "about:config" 15 "message": "(this is different from Adblock and Adblock Plus 0.5 that use th e prefix"
16 }, 16 },
17 "s5": { 17 "s5": {
18 "message": ". All of them start with" 18 "message": "adblock."
19 }, 19 },
20 "s6": { 20 "s6": {
21 "message": "extensions.adblockplus." 21 "message": "). A full list with explanations can be found <a>here</a>."
22 }, 22 },
23 "s7": { 23 "s7": {
24 "message": "(this is different from Adblock and Adblock Plus 0.5 that use th e prefix" 24 "message": "How do I access Adblock Plus from my extension?"
25 }, 25 },
26 "s8": { 26 "s8": {
27 "message": "adblock." 27 "message": "To allow other extensions to integrate with Adblock Plus the int erface"
28 }, 28 },
29 "s9": { 29 "s9": {
30 "message": "). A full list with explanations can be found <a>here</a>." 30 "message": "IAdblockPlus"
31 }, 31 },
32 "s10": { 32 "s10": {
33 "message": "How do I access Adblock Plus from my extension?" 33 "message": "is exported. Check out <a>interface documentation</a> for detail s."
34 }, 34 },
35 "s11": { 35 "s11": {
36 "message": "To allow other extensions to integrate with Adblock Plus the int erface" 36 "message": "How does Adblock Plus block addresses?"
37 }, 37 },
38 "s12": { 38 "s12": {
39 "message": "IAdblockPlus" 39 "message": "The hard work here is actually done by Gecko, the engine on top of which Firefox, Thunderbird and other applications are built. It allows someth ing called \"content policies\". A content policy is simply a JavaScript (or C++ ) object that gets called whenever the browser needs to load something. It can t hen look at the address that should be loaded and some other data and decide whe ther it should be allowed. There is a number of built-in content policies (when you define which sites shouldn't be allowed to load images in Firefox or SeaMonk ey, you are actually configuring one of these built-in content policies) and any extension can register one. So all that Adblock Plus has to do is to register i ts content policy, other than that there is only application logic to decide whi ch addresses to block and user interface code to allow configuration of filters. "
40 }, 40 },
41 "s13": { 41 "s13": {
42 "message": "is exported. Check out <a>interface documentation</a> for detail s." 42 "message": "For developers: to register a content policy you have to <a>writ e an XPCOM component</a> that should implement the <a>nsIContentPolicy interface </a>. Make sure to adjust the module's registerSelf method to register your comp onent in the \"content-policy\" category (use the <a>category manager</a> for th is). That's it, now your component's shouldLoad method will be called and you ca n decide whether the specific request should be accepted or not."
43 }, 43 },
44 "s14": { 44 "s14": {
45 "message": "How does Adblock Plus block addresses?" 45 "message": "How does Adblock Plus process its filters and which filters are faster?"
46 }, 46 },
47 "s15": { 47 "s15": {
48 "message": "The hard work here is actually done by Gecko, the engine on top of which Firefox, Thunderbird and other applications are built. It allows someth ing called \"content policies\". A content policy is simply a JavaScript (or C++ ) object that gets called whenever the browser needs to load something. It can t hen look at the address that should be loaded and some other data and decide whe ther it should be allowed. There is a number of built-in content policies (when you define which sites shouldn't be allowed to load images in Firefox or SeaMonk ey, you are actually configuring one of these built-in content policies) and any extension can register one. So all that Adblock Plus has to do is to register i ts content policy, other than that there is only application logic to decide whi ch addresses to block and user interface code to allow configuration of filters. " 48 "message": "All filters a translated into <a>regular expressions</a> interna lly, even the ones that haven't been specified as such. For example, the filter"
49 }, 49 },
50 "s16": { 50 "s16": {
51 "message": "For developers: to register a content policy you have to" 51 "message": "ad*banner.gif|"
52 }, 52 },
53 "s17": { 53 "s17": {
54 "message": "http://developer.mozilla.org/en/docs/How_to_Build_an_XPCOM_Compo nent_in_Javascript" 54 "message": "will be translated into the regular expression"
55 }, 55 },
56 "s18": { 56 "s18": {
57 "message": "write an XPCOM component" 57 "message": "/ad.*banner\\.gif$/"
58 }, 58 },
59 "s19": { 59 "s19": {
60 "message": "that should implement the" 60 "message": ". However, when Adblock Plus is given an address that should be checked against all filters it doesn't simply test all filters one after another -- that would slow down the browsing unnecessarily."
61 }, 61 },
62 "s20": { 62 "s20": {
63 "message": "http://www.xulplanet.com/references/xpcomref/ifaces/nsIContentPo licy.html" 63 "message": "Besides of translating filters into regular expressions Adblock Plus also tries to extract text information from them. What it needs is a unique string of eight characters (a \"shortcut\") that must be present in every addre ss matched by the filter (the length is arbitrary, eight just seems reasonable h ere). For example, if you have a filter"
64 }, 64 },
65 "s21": { 65 "s21": {
66 "message": "nsIContentPolicy interface" 66 "message": "|http://ad.*"
67 }, 67 },
68 "s22": { 68 "s22": {
69 "message": ". Make sure to adjust the module's registerSelf method to regist er your component in the \"content-policy\" category (use the" 69 "message": "then Adblock Plus has the choice between \"http://a\", \"ttp://a d\" and \"tp://ad.\", any of these strings will always be present in whatever th is filter will match. Unfortunately finding a shortcut for filters that simply d on't have eight characters unbroken by wildcards or for filters that have been s pecified as regular expressions is impossible."
70 }, 70 },
71 "s23": { 71 "s23": {
72 "message": "http://www.xulplanet.com/references/xpcomref/ifaces/nsICategoryM anager.html" 72 "message": "All shortcuts are put into a lookup table, Adblock Plus can find the filter by its shortcut very efficiently. Then, when a specific address has to be tested Adblock Plus will first look for known shortcuts there (this can be done very fast, the time needed is almost independent from the number of shortc uts). Only when a shortcut is found the string will be tested against the regula r expression of the corresponding filter. However, filters without a shortcut st ill have to be tested one after another which is slow."
73 }, 73 },
74 "s24": { 74 "s24": {
75 "message": "category manager" 75 "message": "To sum up: which filters should be used to make a filter list fa st? You should use as few regular expressions as possible, those are always slow . You also should make sure that simple filters have at least eight characters o f unbroken text (meaning that these don't contain any characters with a special meaning like *), otherwise they will be just as slow as regular expressions. But with filters that qualify it doesn't matter how many filters you have, the proc essing time is always the same. That means that if you need 20 simple filters to replace one regular expression then it is still worth it. Speaking of which -- the <a>deregifier</a> is very recommendable."
76 }, 76 },
77 "s25": { 77 "s25": {
78 "message": "for this). That's it, now your component's shouldLoad method wil l be called and you can decide whether the specific request should be accepted o r not." 78 "message": "The filter matching algorithm in detail"
79 }, 79 },
80 "s26": { 80 "s26": {
81 "message": "How does Adblock Plus process its filters and which filters are faster?" 81 "message": "How does element hiding work?"
82 }, 82 },
83 "s27": { 83 "s27": {
84 "message": "All filters a translated into <a>regular expressions</a> interna lly, even the ones that haven't been specified as such. For example, the filter" 84 "message": "Element hiding rules are translated into <a>CSS</a> and applied to all web pages the user is visiting. A rule like"
85 }, 85 },
86 "s28": { 86 "s28": {
87 "message": "ad*banner.gif|" 87 "message": "example.com#div(evil_ad)"
88 }, 88 },
89 "s29": { 89 "s29": {
90 "message": "will be translated into the regular expression" 90 "message": "then looks like:"
91 }, 91 },
92 "s30": { 92 "s30": {
93 "message": "/ad.*banner\\.gif$/" 93 "message": "@-moz-document is a proposed extension to the CSS standard, you can read more about it in the <a>Mozilla Developer Center</a>."
94 }, 94 },
95 "s31": { 95 "s31": {
96 "message": ". However, when Adblock Plus is given an address that should be checked against all filters it doesn't simply test all filters one after another -- that would slow down the browsing unnecessarily." 96 "message": "Rules that are not restricted to a certain domain will be restri cted to the protocols http:// and https:// to prevent them from hiding elements of the browser's user interface (it is using the chrome:// protocol scheme). For example the rule"
97 }, 97 },
98 "s32": { 98 "s32": {
99 "message": "Besides of translating filters into regular expressions Adblock Plus also tries to extract text information from them. What it needs is a unique string of eight characters (a \"shortcut\") that must be present in every addre ss matched by the filter (the length is arbitrary, eight just seems reasonable h ere). For example, if you have a filter" 99 "message": "#div(evil_ad)"
100 }, 100 },
101 "s33": { 101 "s33": {
102 "message": "|http://ad.*" 102 "message": "will be translated into:"
103 }, 103 },
104 "s34": { 104 "s34": {
105 "message": "then Adblock Plus has the choice between \"http://a\", \"ttp://a d\" and \"tp://ad.\", any of these strings will always be present in whatever th is filter will match. Unfortunately finding a shortcut for filters that simply d on't have eight characters unbroken by wildcards or for filters that have been s pecified as regular expressions is impossible." 105 "message": "For developers: Adblock Plus is using the <a>stylesheet service< /a> here. This interface came with Gecko 1.8 and allows extensions to add user s tylesheets dynamically (before that you could only modify userContent.css which requires you to restart the browser). User stylesheets will overwrite CSS code o f all web sites, they have the highest possible <a>importance</a>."
106 }, 106 },
107 "s35": { 107 "s35": {
108 "message": "All shortcuts are put into a lookup table, Adblock Plus can find the filter by its shortcut very efficiently. Then, when a specific address has to be tested Adblock Plus will first look for known shortcuts there (this can be done very fast, the time needed is almost independent from the number of shortc uts). Only when a shortcut is found the string will be tested against the regula r expression of the corresponding filter. However, filters without a shortcut st ill have to be tested one after another which is slow." 108 "message": "What can the first line of a filters file look like?"
109 }, 109 },
110 "s36": { 110 "s36": {
111 "message": "To sum up: which filters should be used to make a filter list fa st? You should use as few regular expressions as possible, those are always slow . You also should make sure that simple filters have at least eight characters o f unbroken text (meaning that these don't contain any characters with a special meaning like *), otherwise they will be just as slow as regular expressions. But with filters that qualify it doesn't matter how many filters you have, the proc essing time is always the same. That means that if you need 20 simple filters to replace one regular expression then it is still worth it. Speaking of which -- the <a>deregifier</a> is very recommendable." 111 "message": "Usually the first line of a filters file is simply"
112 }, 112 },
113 "s37": { 113 "s37": {
114 "message": "The filter matching algorithm in detail" 114 "message": "[Adblock]"
115 }, 115 },
116 "s38": { 116 "s38": {
117 "message": "How does element hiding work?" 117 "message": ". However, you might have noticed that recent versions of Adbloc k Plus sometimes put a different text instead. This is done when you have filter s in your list that use advanced filter syntax only supported by newer versions of Adblock Plus but not original Adblock. One example would be:"
118 }, 118 },
119 "s39": { 119 "s39": {
120 "message": "Element hiding rules are translated into" 120 "message": "This is simply a comment. Adblock (and Adblock Plus for that rea son) will ignore anything before the actual mark. The required Adblock Plus vers ion is not enforced because Adblock Plus 0.6.1.2 didn't support it. However, if you use even newer filter syntax, you might get something like:"
121 }, 121 },
122 "s40": { 122 "s40": {
123 "message": "http://www.w3.org/TR/CSS21/" 123 "message": "This type of header is supported starting with Adblock Plus 0.7. 1. Older Adblock Plus versions and Adblock cannot open files starting with this header. As to the current versions, they will check the version number in the he ader and compare it with their own version number. If the file happens to requir e a newer Adblock Plus, the user will be given a message on import asking him to upgrade. Subscriptions will still load files meant for newer Adblock Plus versi ons but display a warning in the preferences dialog."
124 }, 124 },
125 "s41": { 125 "s41": {
126 "message": "CSS" 126 "message": "Finally, if you want to require Adblock Plus but don't want to s pecify the version number you can start the file with"
127 }, 127 },
128 "s42": { 128 "s42": {
129 "message": "and applied to all web pages the user is visiting. A rule like" 129 "message": "[Adblock Plus]"
130 }, 130 },
131 "s43": { 131 "s43": {
132 "message": "example.com#div(evil_ad)"
133 },
134 "s44": {
135 "message": "then looks like:"
136 },
137 "s45": {
138 "message": "@-moz-document domain(example.com)\n{\n div#evil_ad, div.evil_a d\n {\n display: none !important;\n }\n}"
139 },
140 "s46": {
141 "message": "@-moz-document is a proposed extension to the CSS standard, you can read more about it in the"
142 },
143 "s47": {
144 "message": "http://developer.mozilla.org/en/docs/CSS:%40-moz-document"
145 },
146 "s48": {
147 "message": "Mozilla Developer Center"
148 },
149 "s49": {
150 "message": "."
151 },
152 "s50": {
153 "message": "Rules that are not restricted to a certain domain will be restri cted to the protocols http:// and https:// to prevent them from hiding elements of the browser's user interface (it is using the chrome:// protocol scheme). For example the rule"
154 },
155 "s51": {
156 "message": "#div(evil_ad)"
157 },
158 "s52": {
159 "message": "will be translated into:"
160 },
161 "s53": {
162 "message": "@-moz-document url-prefix(http://),url-prefix(https://)\n{\n di v#evil_ad, div.evil_ad\n {\n display: none !important;\n }\n}"
163 },
164 "s54": {
165 "message": "For developers: Adblock Plus is using the"
166 },
167 "s55": {
168 "message": "https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsISt yleSheetService"
169 },
170 "s56": {
171 "message": "stylesheet service"
172 },
173 "s57": {
174 "message": "here. This interface came with Gecko 1.8 and allows extensions t o add user stylesheets dynamically (before that you could only modify userConten t.css which requires you to restart the browser). User stylesheets will overwrit e CSS code of all web sites, they have the highest possible"
175 },
176 "s58": {
177 "message": "http://www.w3.org/TR/CSS21/cascade.html#cascading-order"
178 },
179 "s59": {
180 "message": "importance"
181 },
182 "s60": {
183 "message": "."
184 },
185 "s61": {
186 "message": "What can the first line of a filters file look like?"
187 },
188 "s62": {
189 "message": "Usually the first line of a filters file is simply"
190 },
191 "s63": {
192 "message": "[Adblock]"
193 },
194 "s64": {
195 "message": ". However, you might have noticed that recent versions of Adbloc k Plus sometimes put a different text instead. This is done when you have filter s in your list that use advanced filter syntax only supported by newer versions of Adblock Plus but not original Adblock. One example would be:"
196 },
197 "s65": {
198 "message": "(Adblock Plus 0.6.1.2 or higher required) [Adblock]"
199 },
200 "s66": {
201 "message": "This is simply a comment. Adblock (and Adblock Plus for that rea son) will ignore anything before the actual mark. The required Adblock Plus vers ion is not enforced because Adblock Plus 0.6.1.2 didn't support it. However, if you use even newer filter syntax, you might get something like:"
202 },
203 "s67": {
204 "message": "[Adblock Plus 0.7.1]"
205 },
206 "s68": {
207 "message": "This type of header is supported starting with Adblock Plus 0.7. 1. Older Adblock Plus versions and Adblock cannot open files starting with this header. As to the current versions, they will check the version number in the he ader and compare it with their own version number. If the file happens to requir e a newer Adblock Plus, the user will be given a message on import asking him to upgrade. Subscriptions will still load files meant for newer Adblock Plus versi ons but display a warning in the preferences dialog."
208 },
209 "s69": {
210 "message": "Finally, if you want to require Adblock Plus but don't want to s pecify the version number you can start the file with"
211 },
212 "s70": {
213 "message": "[Adblock Plus]"
214 },
215 "s71": {
216 "message": ". Of course this file will only be accepted by Adblock Plus 0.7. 1 or higher again." 132 "message": ". Of course this file will only be accepted by Adblock Plus 0.7. 1 or higher again."
217 } 133 }
218 } 134 }
OLDNEW
« no previous file with comments | « locales/en/faq_install.json ('k') | locales/en/faq_project.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld