1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-30 03:52:29 +01:00

Filter out duplicate search strings from search keyword term history completion.

This commit is contained in:
Kris Maglione
2015-01-07 17:10:03 -08:00
parent 4a8affde65
commit 147be2614c

View File

@@ -695,13 +695,15 @@ var Bookmarks = Module("bookmarks", {
context.generate = function () {
let [begin, end] = item.url.split("%s");
let seen = RealSet();
return history.get({ uri: util.newURI(begin), uriIsPrefix: true }).map(function (item) {
let rest = item.url.length - end.length;
let query = item.url.substring(begin.length, rest);
if (item.url.substr(rest) == end && query.contains("&"))
try {
item.url = decodeURIComponent(query.replace(/[&#].*/, "").replace(/\+/g, " "));
return item;
if (!seen.add(item.url))
return item;
}
catch (e) {}
return null;