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

Delta Between Two Patch Sets: background.js

Issue 5138680696012800: Issue 616 - Enforce $generichide and $genericblock in Chrome (Closed)
Left Patch Set: Rebased onto typeMask changes Created July 14, 2015, 4:54 p.m.
Right Patch Set: Updated adblockplustests dependency Created Oct. 5, 2015, 9:52 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | dependencies » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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 });
LEFTRIGHT
« no previous file | dependencies » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld