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 { |
| 576 sender.tab.sendMessage(msg.payload, sendResponse); |
| 577 // Return true to indicate that we want to call |
| 578 // sendResponse asynchronously |
| 579 return true; |
| 580 } |
575 break; | 581 break; |
576 default: | 582 default: |
577 sendResponse({}); | 583 sendResponse({}); |
578 break; | 584 break; |
579 } | 585 } |
580 }); | 586 }); |
581 | 587 |
582 // Show icon as page action for all tabs that already exist | 588 // Show icon as page action for all tabs that already exist |
583 ext.windows.getAll(function(windows) | 589 ext.windows.getAll(function(windows) |
584 { | 590 { |
(...skipping 12 matching lines...) Expand all Loading... |
597 tab.sendMessage({type: "clickhide-deactivate"}); | 603 tab.sendMessage({type: "clickhide-deactivate"}); |
598 refreshIconAndContextMenu(tab); | 604 refreshIconAndContextMenu(tab); |
599 }); | 605 }); |
600 | 606 |
601 setTimeout(function() | 607 setTimeout(function() |
602 { | 608 { |
603 var notificationToShow = Notification.getNextToShow(); | 609 var notificationToShow = Notification.getNextToShow(); |
604 if (notificationToShow) | 610 if (notificationToShow) |
605 showNotification(notificationToShow); | 611 showNotification(notificationToShow); |
606 }, 3 * 60 * 1000); | 612 }, 3 * 60 * 1000); |
OLD | NEW |