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-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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 FilterStorage.addFilter(Filter.fromText(msg.filters[i])); | 564 FilterStorage.addFilter(Filter.fromText(msg.filters[i])); |
565 } | 565 } |
566 break; | 566 break; |
567 case "add-subscription": | 567 case "add-subscription": |
568 openOptions(function(tab) | 568 openOptions(function(tab) |
569 { | 569 { |
570 tab.sendMessage(msg); | 570 tab.sendMessage(msg); |
571 }); | 571 }); |
572 break; | 572 break; |
573 case "forward": | 573 case "forward": |
574 tab.sendMessage(msg.payload, sendResponse); | 574 if (sender.tab) |
| 575 sender.tab.sendMessage(msg.payload, sendResponse); |
575 break; | 576 break; |
576 default: | 577 default: |
577 sendResponse({}); | 578 sendResponse({}); |
578 break; | 579 break; |
579 } | 580 } |
580 }); | 581 }); |
581 | 582 |
582 // Show icon as page action for all tabs that already exist | 583 // Show icon as page action for all tabs that already exist |
583 ext.windows.getAll(function(windows) | 584 ext.windows.getAll(function(windows) |
584 { | 585 { |
(...skipping 12 matching lines...) Expand all Loading... |
597 tab.sendMessage({type: "clickhide-deactivate"}); | 598 tab.sendMessage({type: "clickhide-deactivate"}); |
598 refreshIconAndContextMenu(tab); | 599 refreshIconAndContextMenu(tab); |
599 }); | 600 }); |
600 | 601 |
601 setTimeout(function() | 602 setTimeout(function() |
602 { | 603 { |
603 var notificationToShow = Notification.getNextToShow(); | 604 var notificationToShow = Notification.getNextToShow(); |
604 if (notificationToShow) | 605 if (notificationToShow) |
605 showNotification(notificationToShow); | 606 showNotification(notificationToShow); |
606 }, 3 * 60 * 1000); | 607 }, 3 * 60 * 1000); |
OLD | NEW |