| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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); |
| OLD | NEW |