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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // Sometimes a frame is added and removed very quickly, in such cases we | 191 // Sometimes a frame is added and removed very quickly, in such cases we |
192 // simply ignore the error. | 192 // simply ignore the error. |
193 if (error.message == "The frame was removed.") | 193 if (error.message == "The frame was removed.") |
194 return; | 194 return; |
195 | 195 |
196 throw error; | 196 throw error; |
197 }); | 197 }); |
198 } | 198 } |
199 catch (error) | 199 catch (error) |
200 { | 200 { |
| 201 // See the comment in the catch block associated with the call to |
| 202 // tabs.insertCSS for why we catch and ignore any errors here. |
201 } | 203 } |
202 } | 204 } |
203 | 205 |
204 port.on("content.applyFilters", (message, sender) => | 206 port.on("content.applyFilters", (message, sender) => |
205 { | 207 { |
206 let selectors = []; | 208 let selectors = []; |
207 let emulatedPatterns = []; | 209 let emulatedPatterns = []; |
208 let trace = HitLogger.hasListener(sender.page.id); | 210 let trace = HitLogger.hasListener(sender.page.id); |
209 let inline = !userStyleSheetsSupported; | 211 let inline = !userStyleSheetsSupported; |
210 | 212 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors, | 261 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors, |
260 message.groupName, message.appendOnly); | 262 message.groupName, message.appendOnly); |
261 }); | 263 }); |
262 | 264 |
263 fetch(browser.extension.getURL("/snippets.js"), {cache: "no-cache"}) | 265 fetch(browser.extension.getURL("/snippets.js"), {cache: "no-cache"}) |
264 .then(response => response.ok ? response.text() : "") | 266 .then(response => response.ok ? response.text() : "") |
265 .then(text => | 267 .then(text => |
266 { | 268 { |
267 snippetsLibrarySource = text; | 269 snippetsLibrarySource = text; |
268 }); | 270 }); |
LEFT | RIGHT |