diff options
author | gorhill <rhill@raymondhill.net> | 2015-08-03 09:25:18 -0400 |
---|---|---|
committer | gorhill <rhill@raymondhill.net> | 2015-08-03 09:25:18 -0400 |
commit | 980125b8afcf8d5d32eeeb39a2668fb32e454117 (patch) | |
tree | c5125ab127249ddaeffd48667e66ecc62d33b89e /platform/chromium | |
parent | 6ea3338f262b1de044bc516aead2bf4bd822445c (diff) | |
download | uBlock-980125b8afcf8d5d32eeeb39a2668fb32e454117.zip uBlock-980125b8afcf8d5d32eeeb39a2668fb32e454117.tar.gz uBlock-980125b8afcf8d5d32eeeb39a2668fb32e454117.tar.bz2 |
minor code review
Diffstat (limited to 'platform/chromium')
-rw-r--r-- | platform/chromium/vapi-background.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 8bedd15..6237124 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -375,11 +375,8 @@ vAPI.tabs.open = function(details) { // "Note that fragment identifiers are not matched." // It's a lie, fragment identifiers ARE matched. So we need to remove the // fragment. - var targetURLWithoutHash = targetURL; var pos = targetURL.indexOf('#'); - if ( pos !== -1 ) { - targetURLWithoutHash = targetURL.slice(0, pos); - } + var targetURLWithoutHash = pos === -1 ? targetURL : targetURL.slice(0, pos); chrome.tabs.query({ url: targetURLWithoutHash }, function(tabs) { var tab = tabs[0]; |