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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 26 matching lines...) Expand all Loading... |
37 let lastRightClickEvent = null; | 37 let lastRightClickEvent = null; |
38 let lastRightClickEventIsMostRecent = false; | 38 let lastRightClickEventIsMostRecent = false; |
39 | 39 |
40 | 40 |
41 /* Utilities */ | 41 /* Utilities */ |
42 | 42 |
43 function getFiltersForElement(element, callback) | 43 function getFiltersForElement(element, callback) |
44 { | 44 { |
45 ext.backgroundPage.sendMessage( | 45 ext.backgroundPage.sendMessage( |
46 { | 46 { |
47 type: "compose-filters", | 47 type: "composer.getFilters", |
48 tagName: element.localName, | 48 tagName: element.localName, |
49 id: element.id, | 49 id: element.id, |
50 src: element.getAttribute("src"), | 50 src: element.getAttribute("src"), |
51 style: element.getAttribute("style"), | 51 style: element.getAttribute("style"), |
52 classes: Array.prototype.slice.call(element.classList), | 52 classes: Array.prototype.slice.call(element.classList), |
53 urls: getURLsFromElement(element), | 53 urls: getURLsFromElement(element), |
54 mediatype: typeMap[element.localName], | 54 mediatype: typeMap[element.localName], |
55 baseURL: document.location.href | 55 baseURL: document.location.href |
56 }, | 56 }, |
57 response => | 57 response => |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 return; | 378 return; |
379 | 379 |
380 let element = currentElement.prisoner || currentElement; | 380 let element = currentElement.prisoner || currentElement; |
381 getFiltersForElement(element, (filters, selectors) => | 381 getFiltersForElement(element, (filters, selectors) => |
382 { | 382 { |
383 if (currentlyPickingElement) | 383 if (currentlyPickingElement) |
384 stopPickingElement(); | 384 stopPickingElement(); |
385 | 385 |
386 ext.backgroundPage.sendMessage( | 386 ext.backgroundPage.sendMessage( |
387 { | 387 { |
388 type: "blockelement-open-popup" | 388 type: "composer.openDialog" |
389 }, | 389 }, |
390 popupId => | 390 popupId => |
391 { | 391 { |
392 ext.backgroundPage.sendMessage( | 392 ext.backgroundPage.sendMessage( |
393 { | 393 { |
394 type: "forward", | 394 type: "forward", |
395 targetPageId: popupId, | 395 targetPageId: popupId, |
396 payload: | 396 payload: |
397 { | 397 { |
398 type: "blockelement-popup-init", | 398 type: "blockelement-popup-init", |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 { | 578 { |
579 type: "blockelement-finished" | 579 type: "blockelement-finished" |
580 } | 580 } |
581 }); | 581 }); |
582 } | 582 } |
583 break; | 583 break; |
584 } | 584 } |
585 }); | 585 }); |
586 | 586 |
587 if (window == window.top) | 587 if (window == window.top) |
588 ext.backgroundPage.sendMessage({type: "report-html-page"}); | 588 ext.backgroundPage.sendMessage({type: "composer.ready"}); |
589 } | 589 } |
OLD | NEW |