| 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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 function hasRecord(panel, request, filter) | 79 function hasRecord(panel, request, filter) |
| 80 { | 80 { |
| 81 return panel.records.some(record => | 81 return panel.records.some(record => |
| 82 record.request.url == request.url && | 82 record.request.url == request.url && |
| 83 record.request.docDomain == request.docDomain && | 83 record.request.docDomain == request.docDomain && |
| 84 | 84 |
| 85 // Ignore partial (e.g. ELEMHIDE) whitelisting if there is already | 85 // Ignore partial (e.g. ELEMHIDE) whitelisting if there is already |
| 86 // a DOCUMENT exception which disables all means of blocking. | 86 // a DOCUMENT exception which disables all means of blocking. |
| 87 (record.request.type == "DOCUMENT" ? | 87 (record.request.type == "DOCUMENT" ? |
| 88 nonRequestTypes.indexOf(request.type) != -1 : | 88 nonRequestTypes.includes(request.type) : |
| 89 record.request.type == request.type) && | 89 record.request.type == request.type) && |
| 90 | 90 |
| 91 // Matched element hiding filters don't relate to a particular request, | 91 // Matched element hiding filters don't relate to a particular request, |
| 92 // so we have to compare the selector in order to avoid duplicates. | 92 // so we have to compare the selector in order to avoid duplicates. |
| 93 (record.filter && record.filter.selector) == (filter && filter.selector) | 93 (record.filter && record.filter.selector) == (filter && filter.selector) |
| 94 ); | 94 ); |
| 95 } | 95 } |
| 96 | 96 |
| 97 function addRecord(panel, request, filter) | 97 function addRecord(panel, request, filter) |
| 98 { | 98 { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 panels[inspectedTabId] = {port: newPort, records: []}; | 377 panels[inspectedTabId] = {port: newPort, records: []}; |
| 378 }); | 378 }); |
| 379 | 379 |
| 380 port.on("devtools.traceElemHide", (message, sender) => | 380 port.on("devtools.traceElemHide", (message, sender) => |
| 381 { | 381 { |
| 382 logHiddenElements( | 382 logHiddenElements( |
| 383 sender.page, message.selectors, | 383 sender.page, message.selectors, |
| 384 extractHostFromFrame(sender.frame) | 384 extractHostFromFrame(sender.frame) |
| 385 ); | 385 ); |
| 386 }); | 386 }); |
| LEFT | RIGHT |