diff --git a/background/storage.js b/background/storage.js index 0ca98ca2..e7a1153f 100644 --- a/background/storage.js +++ b/background/storage.js @@ -28,14 +28,3 @@ function calcStyleDigest(style) { return parts.join(''); } } - -/* - According to CSS4 @document specification the entire URL must match. - Stylish-for-Chrome implemented it incorrectly since the very beginning. - We'll detect styles that abuse the bug by finding the sections that - would have been applied by Stylish but not by us as we follow the spec. - Additionally we'll check for invalid regexps. -*/ -function detectSloppyRegexps({matchUrl, ids}) { - // TODO -} diff --git a/background/style-manager.js b/background/style-manager.js index a276c911..7031d5b8 100644 --- a/background/style-manager.js +++ b/background/style-manager.js @@ -142,7 +142,7 @@ const styleManager = (() => { } else { data = Object.assign({}, style.data, data); } - // FIXME: update installDate? + // FIXME: update updateDate? what about usercss config? return calcStyleDigest(data) .then(digest => { data.originalDigest = digest; @@ -420,9 +420,16 @@ const styleManager = (() => { if (section.regexps && section.regexps.some(r => compileRe(r).test(url))) { return true; } + /* + According to CSS4 @document specification the entire URL must match. + Stylish-for-Chrome implemented it incorrectly since the very beginning. + We'll detect styles that abuse the bug by finding the sections that + would have been applied by Stylish but not by us as we follow the spec. + */ if (section.regexps && section.regexps.some(r => compileSloppyRe(r).test(url))) { return 'sloppy'; } + // TODO: check for invalid regexps? if ( (!section.regexps || !section.regexps.length) && (!section.urlPrefixes || !section.urlPrefixes.length) &&