exact match pref should work for custom mode too
This commit is contained in:
parent
817c1a7fb1
commit
ec1b8c1b41
1 changed files with 9 additions and 1 deletions
10
common.js
10
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)];
|
||||
|
|
Loading…
Reference in a new issue