LEFT | RIGHT |
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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 { | 298 { |
299 switch (msg.type) | 299 switch (msg.type) |
300 { | 300 { |
301 case "get-selectors": | 301 case "get-selectors": |
302 var selectors = []; | 302 var selectors = []; |
303 | 303 |
304 if (!isFrameWhitelisted(sender.page, sender.frame, | 304 if (!isFrameWhitelisted(sender.page, sender.frame, |
305 RegExpFilter.typeMap.DOCUMENT | RegExpFilter.typeM
ap.ELEMHIDE)) | 305 RegExpFilter.typeMap.DOCUMENT | RegExpFilter.typeM
ap.ELEMHIDE)) |
306 { | 306 { |
307 var noStyleRules = false; | 307 var noStyleRules = false; |
308 var specificOnly = isFrameWhitelisted(sender.page, sender.frame, RegExpF
ilter.typeMap.GENERICHIDE); | 308 var specificOnly = isFrameWhitelisted(sender.page, sender.frame, |
| 309 RegExpFilter.typeMap.GENERICHIDE); |
309 var host = extractHostFromFrame(sender.frame); | 310 var host = extractHostFromFrame(sender.frame); |
310 | 311 |
311 for (var i = 0; i < noStyleRulesHosts.length; i++) | 312 for (var i = 0; i < noStyleRulesHosts.length; i++) |
312 { | 313 { |
313 var noStyleHost = noStyleRulesHosts[i]; | 314 var noStyleHost = noStyleRulesHosts[i]; |
314 if (host == noStyleHost || (host.length > noStyleHost.length && | 315 if (host == noStyleHost || (host.length > noStyleHost.length && |
315 host.substr(host.length - noStyleHost.leng
th - 1) == "." + noStyleHost)) | 316 host.substr(host.length - noStyleHost.leng
th - 1) == "." + noStyleHost)) |
316 { | 317 { |
317 noStyleRules = true; | 318 noStyleRules = true; |
318 } | 319 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 break; | 427 break; |
427 } | 428 } |
428 }); | 429 }); |
429 | 430 |
430 // update icon when page changes location | 431 // update icon when page changes location |
431 ext.pages.onLoading.addListener(function(page) | 432 ext.pages.onLoading.addListener(function(page) |
432 { | 433 { |
433 page.sendMessage({type: "clickhide-deactivate"}); | 434 page.sendMessage({type: "clickhide-deactivate"}); |
434 refreshIconAndContextMenu(page); | 435 refreshIconAndContextMenu(page); |
435 }); | 436 }); |
LEFT | RIGHT |