Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: lib/contentFiltering.js

Issue 29737561: Issue 6539, 6782 - Implement support for snippets (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Fix formatting for content.applyFilters message Created July 19, 2018, 2:10 p.m.
Right Patch Set: Add explanatory comment in catch block Created July 19, 2018, 3:51 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « include.preload.js ('k') | metadata.chrome » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld