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

Side by Side Diff: lib/contentFiltering.js

Issue 29836559: Issue 6539, 6782 - Ignore tabs.executeScript error when frame not found (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created July 23, 2018, 5:09 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 matchAboutBlank: true, 186 matchAboutBlank: true,
187 runAt: "document_start" 187 runAt: "document_start"
188 }) 188 })
189 .catch(error => 189 .catch(error =>
190 { 190 {
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 // Sometimes the frame in question is just not found. We don't know why
197 // this is exactly, but we simply ignore the error.
198 if (/^No frame with id \d+ in tab \d+\.$/.test(error.message))
199 return;
200
196 throw error; 201 throw error;
197 }); 202 });
198 } 203 }
199 catch (error) 204 catch (error)
200 { 205 {
201 // See the comment in the catch block associated with the call to 206 // See the comment in the catch block associated with the call to
202 // tabs.insertCSS for why we catch and ignore any errors here. 207 // tabs.insertCSS for why we catch and ignore any errors here.
203 } 208 }
204 } 209 }
205 210
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors, 266 updateFrameStyles(sender.page.id, sender.frame.id, message.selectors,
262 message.groupName, message.appendOnly); 267 message.groupName, message.appendOnly);
263 }); 268 });
264 269
265 fetch(browser.extension.getURL("/snippets.js"), {cache: "no-cache"}) 270 fetch(browser.extension.getURL("/snippets.js"), {cache: "no-cache"})
266 .then(response => response.ok ? response.text() : "") 271 .then(response => response.ok ? response.text() : "")
267 .then(text => 272 .then(text =>
268 { 273 {
269 snippetsLibrarySource = text; 274 snippetsLibrarySource = text;
270 }); 275 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld