| 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-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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
| 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
| 16 */ | 16 */ |
| 17 | 17 |
| 18 /** @module cssInjection */ | 18 /** @module cssInjection */ |
| 19 | 19 |
| 20 "use strict"; | 20 import {RegExpFilter} from "filterClasses"; |
| 21 | 21 import {ElemHide} from "elemHide"; |
| 22 const {RegExpFilter} = require("filterClasses"); | 22 import {ElemHideEmulation} from "elemHideEmulation"; |
| 23 const {ElemHide} = require("elemHide"); | 23 import {checkWhitelisted} from "whitelisting"; |
| 24 const {ElemHideEmulation} = require("elemHideEmulation"); | 24 import {extractHostFromFrame} from "url"; |
| 25 const {checkWhitelisted} = require("whitelisting"); | 25 import {port} from "messaging"; |
| 26 const {extractHostFromFrame} = require("url"); | 26 import devtools from "devtools"; |
| 27 const {port} = require("messaging"); | 27 import info from "info"; |
| 28 const devtools = require("devtools"); | |
| 29 const info = require("info"); | |
| 30 | 28 |
| 31 // Chromium's support for tabs.removeCSS is still a work in progress and the | 29 // Chromium's support for tabs.removeCSS is still a work in progress and the |
| 32 // API is likely to be different from Firefox's; for now we just don't use it | 30 // API is likely to be different from Firefox's; for now we just don't use it |
| 33 // at all, even if it's available. | 31 // at all, even if it's available. |
| 34 // See https://crbug.com/608854 | 32 // See https://crbug.com/608854 |
| 35 const styleSheetRemovalSupported = info.platform == "gecko"; | 33 const styleSheetRemovalSupported = info.platform == "gecko"; |
| 36 | 34 |
| 37 const selectorGroupSize = 1024; | 35 const selectorGroupSize = 1024; |
| 38 | 36 |
| 39 let userStyleSheetsSupported = true; | 37 let userStyleSheetsSupported = true; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 response.inlineEmulated = true; | 177 response.inlineEmulated = true; |
| 180 | 178 |
| 181 return response; | 179 return response; |
| 182 }); | 180 }); |
| 183 | 181 |
| 184 port.on("elemhide.injectSelectors", (message, sender) => | 182 port.on("elemhide.injectSelectors", (message, sender) => |
| 185 { | 183 { |
| 186 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors, | 184 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors, |
| 187 message.groupName); | 185 message.groupName); |
| 188 }); | 186 }); |
| OLD | NEW |