| LEFT | RIGHT |
| 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 FilterStorage.addFilter(Filter.fromText(msg.filters[i])); | 551 FilterStorage.addFilter(Filter.fromText(msg.filters[i])); |
| 552 } | 552 } |
| 553 break; | 553 break; |
| 554 case "add-subscription": | 554 case "add-subscription": |
| 555 openOptions(function(page) | 555 openOptions(function(page) |
| 556 { | 556 { |
| 557 page.sendMessage(msg); | 557 page.sendMessage(msg); |
| 558 }); | 558 }); |
| 559 break; | 559 break; |
| 560 case "add-sitekey": | 560 case "add-sitekey": |
| 561 processKey(msg.sitekey, sender.page, sender.frame); | 561 processKey(msg.token, sender.page, sender.frame); |
| 562 break; | 562 break; |
| 563 case "forward": | 563 case "forward": |
| 564 if (sender.page) | 564 if (sender.page) |
| 565 { | 565 { |
| 566 sender.page.sendMessage(msg.payload, sendResponse); | 566 sender.page.sendMessage(msg.payload, sendResponse); |
| 567 // Return true to indicate that we want to call | 567 // Return true to indicate that we want to call |
| 568 // sendResponse asynchronously | 568 // sendResponse asynchronously |
| 569 return true; | 569 return true; |
| 570 } | 570 } |
| 571 break; | 571 break; |
| 572 default: | 572 default: |
| 573 sendResponse({}); | 573 sendResponse({}); |
| 574 break; | 574 break; |
| 575 } | 575 } |
| 576 }); | 576 }); |
| 577 | 577 |
| 578 // update icon when page changes location | 578 // update icon when page changes location |
| 579 ext.pages.onLoading.addListener(function(page) | 579 ext.pages.onLoading.addListener(function(page) |
| 580 { | 580 { |
| 581 page.sendMessage({type: "clickhide-deactivate"}); | 581 page.sendMessage({type: "clickhide-deactivate"}); |
| 582 refreshIconAndContextMenu(page); | 582 refreshIconAndContextMenu(page); |
| 583 }); | 583 }); |
| 584 | 584 |
| 585 setTimeout(function() | 585 setTimeout(function() |
| 586 { | 586 { |
| 587 var notificationToShow = Notification.getNextToShow(); | 587 var notificationToShow = Notification.getNextToShow(); |
| 588 if (notificationToShow) | 588 if (notificationToShow) |
| 589 showNotification(notificationToShow); | 589 showNotification(notificationToShow); |
| 590 }, 3 * 60 * 1000); | 590 }, 3 * 60 * 1000); |
| LEFT | RIGHT |