Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed May 30, 2017
1 parent 1a6f826 commit c7a9bef
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/js/reverselookup-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'^' +
Expand Down

0 comments on commit c7a9bef

Please sign in to comment.