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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 }); | 546 }); |
547 break; | 547 break; |
548 case "add-sitekey": | 548 case "add-sitekey": |
549 processKey(msg.token, sender.page, sender.frame); | 549 processKey(msg.token, sender.page, sender.frame); |
550 break; | 550 break; |
551 case "report-html-page": | 551 case "report-html-page": |
552 htmlPages.set(sender.page, null); | 552 htmlPages.set(sender.page, null); |
553 refreshIconAndContextMenu(sender.page); | 553 refreshIconAndContextMenu(sender.page); |
554 break; | 554 break; |
555 case "compose-filters": | 555 case "compose-filters": |
556 sendResponse(composeFilters( | 556 sendResponse(composeFilters({ |
557 msg.tagName, msg.id, msg.src, msg.style, | 557 tagName: msg.tagName, |
558 msg.classes, msg.urls, new URL(msg.baseURL) | 558 id: msg.id, |
559 )); | 559 src: msg.src, |
| 560 style: msg.style, |
| 561 classes: msg.classes, |
| 562 urls: msg.urls, |
| 563 type: msg.mediatype, |
| 564 baseURL: msg.baseURL, |
| 565 page: sender.page, |
| 566 frame: sender.frame |
| 567 })); |
560 break; | 568 break; |
561 case "forward": | 569 case "forward": |
562 if (sender.page) | 570 if (sender.page) |
563 { | 571 { |
564 if (msg.expectsResponse) | 572 if (msg.expectsResponse) |
565 { | 573 { |
566 sender.page.sendMessage(msg.payload, sendResponse); | 574 sender.page.sendMessage(msg.payload, sendResponse); |
567 return true; | 575 return true; |
568 } | 576 } |
569 | 577 |
570 sender.page.sendMessage(msg.payload); | 578 sender.page.sendMessage(msg.payload); |
571 } | 579 } |
572 break; | 580 break; |
573 } | 581 } |
574 }); | 582 }); |
575 | 583 |
576 // update icon when page changes location | 584 // update icon when page changes location |
577 ext.pages.onLoading.addListener(function(page) | 585 ext.pages.onLoading.addListener(function(page) |
578 { | 586 { |
579 page.sendMessage({type: "clickhide-deactivate"}); | 587 page.sendMessage({type: "clickhide-deactivate"}); |
580 refreshIconAndContextMenu(page); | 588 refreshIconAndContextMenu(page); |
581 }); | 589 }); |
582 | 590 |
583 setTimeout(function() | 591 setTimeout(function() |
584 { | 592 { |
585 var notificationToShow = NotificationStorage.getNextToShow(); | 593 var notificationToShow = NotificationStorage.getNextToShow(); |
586 if (notificationToShow) | 594 if (notificationToShow) |
587 showNotification(notificationToShow); | 595 showNotification(notificationToShow); |
588 }, 3 * 60 * 1000); | 596 }, 3 * 60 * 1000); |
OLD | NEW |