| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 case "add-sitekey": | 553 case "add-sitekey": |
| 554 processKey(msg.token, sender.page, sender.frame); | 554 processKey(msg.token, sender.page, sender.frame); |
| 555 break; | 555 break; |
| 556 case "report-html-page": | 556 case "report-html-page": |
| 557 htmlPages.set(sender.page, null); | 557 htmlPages.set(sender.page, null); |
| 558 refreshIconAndContextMenu(sender.page); | 558 refreshIconAndContextMenu(sender.page); |
| 559 break; | 559 break; |
| 560 case "forward": | 560 case "forward": |
| 561 if (sender.page) | 561 if (sender.page) |
| 562 { | 562 { |
| 563 sender.page.sendMessage(msg.payload, sendResponse); | 563 if (msg.expectsResponse) |
| 564 // Return true to indicate that we want to call | 564 { |
| 565 // sendResponse asynchronously | 565 sender.page.sendMessage(msg.payload, sendResponse); |
| 566 return true; | 566 return true; |
| 567 } |
| 568 |
| 569 sender.page.sendMessage(msg.payload); |
| 567 } | 570 } |
| 568 break; | 571 break; |
| 569 } | 572 } |
| 570 }); | 573 }); |
| 571 | 574 |
| 572 // update icon when page changes location | 575 // update icon when page changes location |
| 573 ext.pages.onLoading.addListener(function(page) | 576 ext.pages.onLoading.addListener(function(page) |
| 574 { | 577 { |
| 575 page.sendMessage({type: "clickhide-deactivate"}); | 578 page.sendMessage({type: "clickhide-deactivate"}); |
| 576 refreshIconAndContextMenu(page); | 579 refreshIconAndContextMenu(page); |
| 577 }); | 580 }); |
| 578 | 581 |
| 579 setTimeout(function() | 582 setTimeout(function() |
| 580 { | 583 { |
| 581 var notificationToShow = NotificationStorage.getNextToShow(); | 584 var notificationToShow = NotificationStorage.getNextToShow(); |
| 582 if (notificationToShow) | 585 if (notificationToShow) |
| 583 showNotification(notificationToShow); | 586 showNotification(notificationToShow); |
| 584 }, 3 * 60 * 1000); | 587 }, 3 * 60 * 1000); |
| OLD | NEW |