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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user