From ec1b8c1b41ac988a272df592abf864d25fda58fb Mon Sep 17 00:00:00 2001 From: Ray Lothian Date: Sun, 4 Nov 2018 11:16:25 +0100 Subject: [PATCH] exact match pref should work for custom mode too --- common.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common.js b/common.js index 05cf529..78d7676 100644 --- a/common.js +++ b/common.js @@ -211,7 +211,15 @@ function match({url, tabId}) { } else { const h = hostname(url); - let s = prefs.custom[h] || prefs.custom['*']; + const key = Object.keys(prefs.custom).filter(s => { + if (s === h) { + return true; + } + else if (prefs.exactMatch === false) { + return s.endsWith(h) || h.endsWith(s); + } + }).shift(); + let s = prefs.custom[key] || prefs.custom['*']; // if s is an array select a random string if (Array.isArray(s)) { s = s[Math.floor(Math.random() * s.length)];