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

Delta Between Two Patch Sets: background.js

Issue 29317001: Relocated icon and redesigned icon popup (Closed)
Left Patch Set: Rebased Created Nov. 19, 2013, 1:43 p.m.
Right Patch Set: Merged setBadgeNumber and setBadgeBackgroundColor Created Dec. 13, 2013, 10:36 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
LEFTRIGHT
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-2013 Eyeo GmbH 3 * Copyright (C) 2006-2013 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 var index = url.indexOf("#"); 103 var index = url.indexOf("#");
104 if (index >= 0) 104 if (index >= 0)
105 url = url.substring(0, index); 105 url = url.substring(0, index);
106 106
107 var result = defaultMatcher.matchesAny(url, type || "DOCUMENT", extractHostFro mURL(parentUrl || url), false); 107 var result = defaultMatcher.matchesAny(url, type || "DOCUMENT", extractHostFro mURL(parentUrl || url), false);
108 return (result instanceof WhitelistFilter ? result : null); 108 return (result instanceof WhitelistFilter ? result : null);
109 } 109 }
110 110
111 var activeNotification = null; 111 var activeNotification = null;
112 112
113 // Adds or removes page action icon according to options. 113 // Adds or removes browser action icon according to options.
114 function refreshIconAndContextMenu(tab) 114 function refreshIconAndContextMenu(tab)
115 { 115 {
116 if(!/^https?:/.test(tab.url)) 116 if(!/^https?:/.test(tab.url))
117 return; 117 return;
118 118
119 var iconFilename; 119 var iconFilename;
120 if (require("info").platform == "safari") 120 if (require("info").platform == "safari")
121 // There is no grayscale version of the icon for whitelisted tabs 121 // There is no grayscale version of the icon for whitelisted tabs
122 // when using Safari, because icons are grayscale already and icons 122 // when using Safari, because icons are grayscale already and icons
123 // aren't per tab in Safari. 123 // aren't per tab in Safari.
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 tab.sendMessage({type: "clickhide-deactivate"}); 597 tab.sendMessage({type: "clickhide-deactivate"});
598 refreshIconAndContextMenu(tab); 598 refreshIconAndContextMenu(tab);
599 }); 599 });
600 600
601 setTimeout(function() 601 setTimeout(function()
602 { 602 {
603 var notificationToShow = Notification.getNextToShow(); 603 var notificationToShow = Notification.getNextToShow();
604 if (notificationToShow) 604 if (notificationToShow)
605 showNotification(notificationToShow); 605 showNotification(notificationToShow);
606 }, 3 * 60 * 1000); 606 }, 3 * 60 * 1000);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld