| LEFT | RIGHT |
| 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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 if (!checkWhitelisted(sender.page, sender.frame, | 49 if (!checkWhitelisted(sender.page, sender.frame, |
| 50 RegExpFilter.typeMap.DOCUMENT | | 50 RegExpFilter.typeMap.DOCUMENT | |
| 51 RegExpFilter.typeMap.ELEMHIDE)) | 51 RegExpFilter.typeMap.ELEMHIDE)) |
| 52 { | 52 { |
| 53 let specificOnly = checkWhitelisted(sender.page, sender.frame, | 53 let specificOnly = checkWhitelisted(sender.page, sender.frame, |
| 54 RegExpFilter.typeMap.GENERICHIDE); | 54 RegExpFilter.typeMap.GENERICHIDE); |
| 55 selectors = ElemHide.getSelectorsForDomain( | 55 selectors = ElemHide.getSelectorsForDomain( |
| 56 extractHostFromFrame(sender.frame), | 56 extractHostFromFrame(sender.frame), |
| 57 specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.ALL_MATCHING | 57 specificOnly ? ElemHide.SPECIFIC_ONLY : ElemHide.ALL_MATCHING |
| 58 ); | 58 ); |
| 59 | |
| 60 if (!inject && selectors.length > 0) | |
| 61 hideElements(sender.page.id, sender.frame.id, selectors); | |
| 62 } | 59 } |
| 63 | 60 |
| 61 if (!inject && selectors.length > 0) |
| 62 hideElements(sender.page.id, sender.frame.id, selectors); |
| 63 |
| 64 let response = {trace, inject}; | 64 let response = {trace, inject}; |
| 65 | |
| 66 if (trace || inject) | 65 if (trace || inject) |
| 67 response.selectors = selectors; | 66 response.selectors = selectors; |
| 68 | 67 |
| 69 return response; | 68 return response; |
| 70 }); | 69 }); |
| 71 | 70 |
| 72 port.on("elemhide.injectSelectors", (msg, sender) => | 71 port.on("elemhide.injectSelectors", (msg, sender) => |
| 73 { | 72 { |
| 74 hideElements(sender.page.id, sender.frame.id, msg.selectors); | 73 hideElements(sender.page.id, sender.frame.id, msg.selectors); |
| 75 }); | 74 }); |
| LEFT | RIGHT |