From 4aec3404c4fab95ab4ac0abc0e20c5737312475d Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 21 Mar 2015 23:54:09 -0400 Subject: [PATCH] code review: element picker --- src/js/element-picker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/element-picker.js b/src/js/element-picker.js index ab0a57b22..b81a9498f 100644 --- a/src/js/element-picker.js +++ b/src/js/element-picker.js @@ -248,7 +248,7 @@ var netFilterFromUnion = (function() { var from = lastNetFilterUnion; // Reset reference filter when dealing with unrelated URLs - if ( from === '' && a.host !== lastNetFilterHostname ) { + if ( from === '' || a.host !== lastNetFilterHostname ) { lastNetFilterHostname = a.host; lastNetFilterUnion = to; localMessager.send({ @@ -289,7 +289,7 @@ var netFilterFromUnion = (function() { } } from = fromTokens.join('').replace(/\*\*+/g, '*'); - if ( from !== '/*' ) { + if ( from !== '/*' && from !== to ) { out.push('||' + lastNetFilterHostname + from); } else { from = to;