This commit is contained in:
gorhill 2017-05-30 13:04:01 -04:00
parent 1a6f8266cc
commit c7a9befdab
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -108,8 +108,13 @@ var fromCosmeticFilter = function(details) {
prefix = match[0],
filter = details.rawFilter.slice(prefix.length);
var compiled = JSON.stringify(filter),
reFilter = new RegExp('(^|\\n).*?' + reEscape(compiled) + '.*?(\\n|$)', 'g');
var compiled = JSON.stringify(filter).slice(1, -1),
reFilter = new RegExp(
'(?:^|\\n)[^\\n]*?("|\\")?' +
reEscape(compiled) +
'\\1[^\\n]*?(?:\\n|$)',
'g'
);
var reHostname = new RegExp(
'^' +