From b143ccbcec4770a9aafbca60538d57883a15e555 Mon Sep 17 00:00:00 2001 From: Florrie Date: Sun, 24 Mar 2019 12:04:18 -0300 Subject: Be less verbose with wildcard representations --- extension/popup/main.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'extension/popup/main.js') diff --git a/extension/popup/main.js b/extension/popup/main.js index 1dc39f4..5b95db8 100644 --- a/extension/popup/main.js +++ b/extension/popup/main.js @@ -127,11 +127,11 @@ function loadTrackList(opts) { }); } -function getWildcardRepresentation(rule, urlString = rule.sourceURL) { +function getWildcardRepresentation(rule, verbose = false) { const {hostnameMatch, pathnameMatch} = rule; - const {hostnameParts, pathnameParts} = getURLParts(urlString); + const {hostnameParts, pathnameParts} = getURLParts(rule.sourceURL); - let string = 'http(s)://'; + let string = verbose ? 'http(s)://' : ''; if (hostnameMatch.length !== hostnameParts.length) { if (hostnameMatch.length > 0) { @@ -180,7 +180,7 @@ function loadRuleScreen({tab, rule, saveRule, deleteRule}) { }; const updateWildcardRepresentation = () => { - const string = getWildcardRepresentation(rule, rule.sourceURL); + const string = getWildcardRepresentation(rule, true); const el = document.getElementById('wildcard-representation'); while (el.firstChild) { @@ -297,7 +297,7 @@ function loadRuleList({tab, siteSettings, selectRule}) { const li = document.createElement('li'); li.classList.add('rule'); - li.dataset.wildcardRepresentation = getWildcardRepresentation(rule, rule.sourceURL || tab.url); + li.dataset.wildcardRepresentation = getWildcardRepresentation(rule); li.appendChild(document.createTextNode(li.dataset.wildcardRepresentation)); li.title = li.dataset.wildcardRepresentation; -- cgit 1.3.0-6-gf8a5