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 |
(...skipping 21 matching lines...) Expand all Loading... |
32 { | 32 { |
33 let code = selectors.join(", ") + "{display: none !important;}"; | 33 let code = selectors.join(", ") + "{display: none !important;}"; |
34 | 34 |
35 try | 35 try |
36 { | 36 { |
37 chrome.tabs.insertCSS(tabId, | 37 chrome.tabs.insertCSS(tabId, |
38 { | 38 { |
39 code, | 39 code, |
40 cssOrigin: "user", | 40 cssOrigin: "user", |
41 frameId, | 41 frameId, |
42 matchAboutBlank: true | 42 matchAboutBlank: true, |
| 43 runAt: "document_start" |
43 } | 44 } |
44 ); | 45 ); |
45 return true; | 46 return true; |
46 } | 47 } |
47 catch (error) | 48 catch (error) |
48 { | 49 { |
49 if (/\bError processing cssOrigin\b/.test(error.message) == -1) | 50 if (/\bError processing cssOrigin\b/.test(error.message) == -1) |
50 throw error; | 51 throw error; |
51 | 52 |
52 userStylesheetsSupported = false; | 53 userStylesheetsSupported = false; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 return {trace: false, inject: false}; | 85 return {trace: false, inject: false}; |
85 } | 86 } |
86 | 87 |
87 return {selectors, trace, inject: true}; | 88 return {selectors, trace, inject: true}; |
88 }); | 89 }); |
89 | 90 |
90 port.on("elemhide.injectSelectors", (msg, sender) => | 91 port.on("elemhide.injectSelectors", (msg, sender) => |
91 { | 92 { |
92 return hideElements(sender.page.id, sender.frame.id, msg.selectors); | 93 return hideElements(sender.page.id, sender.frame.id, msg.selectors); |
93 }); | 94 }); |
OLD | NEW |