1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-06 19:02:30 +01:00
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], prefix = match[0],
filter = details.rawFilter.slice(prefix.length); filter = details.rawFilter.slice(prefix.length);
var compiled = JSON.stringify(filter), var compiled = JSON.stringify(filter).slice(1, -1),
reFilter = new RegExp('(^|\\n).*?' + reEscape(compiled) + '.*?(\\n|$)', 'g'); reFilter = new RegExp(
'(?:^|\\n)[^\\n]*?("|\\")?' +
reEscape(compiled) +
'\\1[^\\n]*?(?:\\n|$)',
'g'
);
var reHostname = new RegExp( var reHostname = new RegExp(
'^' + '^' +