| Left: | ||
| Right: |
| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 function addStyleSheet(tabId, frameId, styleSheet) | 69 function addStyleSheet(tabId, frameId, styleSheet) |
| 70 { | 70 { |
| 71 try | 71 try |
| 72 { | 72 { |
| 73 browser.tabs.insertCSS(tabId, { | 73 browser.tabs.insertCSS(tabId, { |
| 74 code: styleSheet, | 74 code: styleSheet, |
| 75 cssOrigin: "user", | 75 cssOrigin: "user", |
| 76 frameId, | 76 frameId, |
| 77 matchAboutBlank: true, | 77 matchAboutBlank: true, |
| 78 runAt: "document_start" | 78 runAt: "document_start" |
| 79 }); | 79 }) |
| 80 .catch(() => {}); | |
|
Sebastian Noack
2018/03/12 22:41:25
To clarify, so the catch-block below is essentiall
Manish Jethani
2018/03/13 06:09:47
On both Firefox and Chrome 65 the error for "cssOr
Sebastian Noack
2018/03/13 15:38:45
I see. Perhaps add some comments here, clarifying
Manish Jethani
2018/03/13 17:14:20
Done.
| |
| 80 } | 81 } |
| 81 catch (error) | 82 catch (error) |
| 82 { | 83 { |
| 83 if (/\bcssOrigin\b/.test(error.message)) | 84 if (/\bcssOrigin\b/.test(error.message)) |
| 84 userStyleSheetsSupported = false; | 85 userStyleSheetsSupported = false; |
| 85 | 86 |
| 86 return false; | 87 return false; |
| 87 } | 88 } |
| 88 | 89 |
| 89 return true; | 90 return true; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 response.inlineEmulated = true; | 180 response.inlineEmulated = true; |
| 180 | 181 |
| 181 return response; | 182 return response; |
| 182 }); | 183 }); |
| 183 | 184 |
| 184 port.on("elemhide.injectSelectors", (message, sender) => | 185 port.on("elemhide.injectSelectors", (message, sender) => |
| 185 { | 186 { |
| 186 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors, | 187 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors, |
| 187 message.groupName); | 188 message.groupName); |
| 188 }); | 189 }); |
| OLD | NEW |