OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 ); | 168 ); |
169 } | 169 } |
170 | 170 |
171 window.collapsing = true; | 171 window.collapsing = true; |
172 } | 172 } |
173 | 173 |
174 function checkSitekey() | 174 function checkSitekey() |
175 { | 175 { |
176 var attr = document.documentElement.getAttribute("data-adblockkey"); | 176 var attr = document.documentElement.getAttribute("data-adblockkey"); |
177 if (attr) | 177 if (attr) |
178 ext.backgroundPage.sendMessage({type: "add-sitekey", token: attr}); | 178 ext.backgroundPage.sendMessage({type: "filter.addKey", token: attr}); |
179 } | 179 } |
180 | 180 |
181 function getContentDocument(element) | 181 function getContentDocument(element) |
182 { | 182 { |
183 try | 183 try |
184 { | 184 { |
185 return element.contentDocument; | 185 return element.contentDocument; |
186 } | 186 } |
187 catch (e) | 187 catch (e) |
188 { | 188 { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 234 } |
235 } | 235 } |
236 | 236 |
237 if (matched) | 237 if (matched) |
238 break; | 238 break; |
239 } | 239 } |
240 } | 240 } |
241 | 241 |
242 if (matchedSelectors.length > 0) | 242 if (matchedSelectors.length > 0) |
243 ext.backgroundPage.sendMessage({ | 243 ext.backgroundPage.sendMessage({ |
244 type: "trace-elemhide", | 244 type: "devtools.traceElemHide", |
245 selectors: matchedSelectors | 245 selectors: matchedSelectors |
246 }); | 246 }); |
247 }, | 247 }, |
248 | 248 |
249 onTimeout: function() | 249 onTimeout: function() |
250 { | 250 { |
251 this.checkNodes(this.changedNodes); | 251 this.checkNodes(this.changedNodes); |
252 this.changedNodes = []; | 252 this.changedNodes = []; |
253 this.timeout = null; | 253 this.timeout = null; |
254 }, | 254 }, |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 }, true); | 537 }, true); |
538 | 538 |
539 return updateStylesheet; | 539 return updateStylesheet; |
540 } | 540 } |
541 | 541 |
542 if (document instanceof HTMLDocument) | 542 if (document instanceof HTMLDocument) |
543 { | 543 { |
544 checkSitekey(); | 544 checkSitekey(); |
545 window.updateStylesheet = init(document); | 545 window.updateStylesheet = init(document); |
546 } | 546 } |
OLD | NEW |