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

Side by Side Diff: background.js

Issue 6236888415338496: Issue 1611 - Fixed inconsistent behavior with "Block element" context menu item (Closed)
Patch Set: Created Nov. 26, 2014, 11:28 a.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 | chrome/ext/background.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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 } 106 }
107 107
108 // Remove deprecated options before we do anything else. 108 // Remove deprecated options before we do anything else.
109 removeDeprecatedOptions(); 109 removeDeprecatedOptions();
110 110
111 var activeNotification = null; 111 var activeNotification = null;
112 112
113 var contextMenuItem = { 113 var contextMenuItem = {
114 title: ext.i18n.getMessage("block_element"), 114 title: ext.i18n.getMessage("block_element"),
115 contexts: ["image", "video", "audio"], 115 contexts: ["image", "video", "audio"],
116 onclick: function(srcUrl, page) 116 onclick: function(page)
117 { 117 {
118 if (srcUrl) 118 page.sendMessage({type: "clickhide-new-filter"});
119 page.sendMessage({type: "clickhide-new-filter", filter: srcUrl});
120 } 119 }
121 }; 120 };
122 121
123 // Adds or removes browser action icon according to options. 122 // Adds or removes browser action icon according to options.
124 function refreshIconAndContextMenu(page) 123 function refreshIconAndContextMenu(page)
125 { 124 {
126 var whitelisted = isWhitelisted(page.url); 125 var whitelisted = isWhitelisted(page.url);
127 126
128 var iconFilename; 127 var iconFilename;
129 if (whitelisted && require("info").platform != "safari") 128 if (whitelisted && require("info").platform != "safari")
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 page.sendMessage({type: "clickhide-deactivate"}); 574 page.sendMessage({type: "clickhide-deactivate"});
576 refreshIconAndContextMenu(page); 575 refreshIconAndContextMenu(page);
577 }); 576 });
578 577
579 setTimeout(function() 578 setTimeout(function()
580 { 579 {
581 var notificationToShow = Notification.getNextToShow(); 580 var notificationToShow = Notification.getNextToShow();
582 if (notificationToShow) 581 if (notificationToShow)
583 showNotification(notificationToShow); 582 showNotification(notificationToShow);
584 }, 3 * 60 * 1000); 583 }, 3 * 60 * 1000);
OLDNEW
« no previous file with comments | « no previous file | chrome/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld