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

Side by Side Diff: background.js

Issue 5989914281771008: Use Shadow DOM for element hiding (Closed)
Patch Set: Fixed Shadow DOM usage and simplified code Created April 15, 2014, 7:06 p.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 | « no previous file | include.preload.js » ('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 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 476 }
477 } 477 }
478 prepareNotificationIconAndPopup(); 478 prepareNotificationIconAndPopup();
479 } 479 }
480 480
481 ext.onMessage.addListener(function (msg, sender, sendResponse) 481 ext.onMessage.addListener(function (msg, sender, sendResponse)
482 { 482 {
483 switch (msg.type) 483 switch (msg.type)
484 { 484 {
485 case "get-selectors": 485 case "get-selectors":
486 var selectors = null; 486 var selectors = [];
487 487
488 if (!isFrameWhitelisted(sender.page, sender.frame, "DOCUMENT") && 488 if (!isFrameWhitelisted(sender.page, sender.frame, "DOCUMENT") &&
489 !isFrameWhitelisted(sender.page, sender.frame, "ELEMHIDE")) 489 !isFrameWhitelisted(sender.page, sender.frame, "ELEMHIDE"))
490 { 490 {
491 var noStyleRules = false; 491 var noStyleRules = false;
492 var host = extractHostFromURL(sender.frame.url); 492 var host = extractHostFromURL(sender.frame.url);
493 for (var i = 0; i < noStyleRulesHosts.length; i++) 493 for (var i = 0; i < noStyleRulesHosts.length; i++)
494 { 494 {
495 var noStyleHost = noStyleRulesHosts[i]; 495 var noStyleHost = noStyleRulesHosts[i];
496 if (host == noStyleHost || (host.length > noStyleHost.length && 496 if (host == noStyleHost || (host.length > noStyleHost.length &&
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 page.sendMessage({type: "clickhide-deactivate"}); 578 page.sendMessage({type: "clickhide-deactivate"});
579 refreshIconAndContextMenu(page); 579 refreshIconAndContextMenu(page);
580 }); 580 });
581 581
582 setTimeout(function() 582 setTimeout(function()
583 { 583 {
584 var notificationToShow = Notification.getNextToShow(); 584 var notificationToShow = Notification.getNextToShow();
585 if (notificationToShow) 585 if (notificationToShow)
586 showNotification(notificationToShow); 586 showNotification(notificationToShow);
587 }, 3 * 60 * 1000); 587 }, 3 * 60 * 1000);
OLDNEW
« no previous file with comments | « no previous file | include.preload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld