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

Unified Diff: lib/cssInjection.js

Issue 29691627: Issue 242 - Do not disable user style sheets on unrelated errors (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Catch all errors but mark userStyleSheetsSupported=false only for cssOrigin error Created Feb. 21, 2018, 3:14 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/cssInjection.js
===================================================================
--- a/lib/cssInjection.js
+++ b/lib/cssInjection.js
@@ -75,20 +75,23 @@
cssOrigin: "user",
frameId,
matchAboutBlank: true,
runAt: "document_start"
});
}
catch (error)
{
- userStyleSheetsSupported = false;
+ if (/\bcssOrigin\b/.test(error.message))
+ userStyleSheetsSupported = false;
+
+ return false;
}
- return userStyleSheetsSupported;
+ return true;
}
function removeStyleSheet(tabId, frameId, styleSheet)
{
if (!styleSheetRemovalSupported)
return;
browser.tabs.removeCSS(tabId, {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld