modified so links open in a new tab
This commit is contained in:
@@ -254,18 +254,18 @@ data:
|
|||||||
.sort((a,b) => b.s - a.s)
|
.sort((a,b) => b.s - a.s)
|
||||||
.slice(0, MAX_RESULTS);
|
.slice(0, MAX_RESULTS);
|
||||||
|
|
||||||
openResult(resultsNow, activeIndex, e.ctrlKey || e.metaKey);
|
openResult(resultsNow, activeIndex);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
overlay.onclick = (e) => { if (e.target === overlay) closeOverlay(); };
|
overlay.onclick = (e) => { if (e.target === overlay) closeOverlay(); };
|
||||||
}
|
}
|
||||||
|
|
||||||
function openResult(results, i, newTab) {
|
function openResult(results, i) {
|
||||||
const r = results[i];
|
const r = results[i];
|
||||||
if (!r) return;
|
if (!r) return;
|
||||||
closeOverlay();
|
closeOverlay();
|
||||||
window.open(r.url, newTab ? '_blank' : '_self');
|
window.open(r.url, '_blank', 'noopener,noreferrer');
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeOverlay() {
|
function closeOverlay() {
|
||||||
|
|||||||
Reference in New Issue
Block a user