mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-06 21:14:11 +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 () {
|
context.generate = function () {
|
||||||
let [begin, end] = item.url.split("%s");
|
let [begin, end] = item.url.split("%s");
|
||||||
|
|
||||||
|
let seen = RealSet();
|
||||||
return history.get({ uri: util.newURI(begin), uriIsPrefix: true }).map(function (item) {
|
return history.get({ uri: util.newURI(begin), uriIsPrefix: true }).map(function (item) {
|
||||||
let rest = item.url.length - end.length;
|
let rest = item.url.length - end.length;
|
||||||
let query = item.url.substring(begin.length, rest);
|
let query = item.url.substring(begin.length, rest);
|
||||||
if (item.url.substr(rest) == end && query.contains("&"))
|
if (item.url.substr(rest) == end && query.contains("&"))
|
||||||
try {
|
try {
|
||||||
item.url = decodeURIComponent(query.replace(/[&#].*/, "").replace(/\+/g, " "));
|
item.url = decodeURIComponent(query.replace(/[&#].*/, "").replace(/\+/g, " "));
|
||||||
return item;
|
if (!seen.add(item.url))
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user