Skip to content

Commit

Permalink
Remove uriIsPrefix (no longer supported) (#655)
Browse files Browse the repository at this point in the history
Fixes #664 - make history faster
  • Loading branch information
devkev authored and maxauthority committed Jan 15, 2017
1 parent a77d9ba commit 1114a56
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/content/bookmarks.js
Expand Up @@ -737,7 +737,9 @@ const Bookmarks = Module("bookmarks", {
context.generate = function () {
let [begin, end] = item.url.split("%s");

return history.get({ uri: window.makeURI(begin), uriIsPrefix: true }).map(function (item) {
return history.get({ domain: window.makeURI(begin).host, domainIsHost: true }).filter(function (item) {
return item.url.startsWith(begin);
}).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.indexOf("&") == -1) {
Expand Down
10 changes: 10 additions & 0 deletions common/content/history.js
Expand Up @@ -18,6 +18,16 @@ const History = Module("history", {
if (typeof filter == "string")
filter = { searchTerms: filter };

try {
for (let k in filter) {
if (filter.hasOwnProperty(k)) {
query[k] = filter[k];
}
}
} catch (e) {
// ?
}

options.sortingMode = options.SORT_BY_DATE_DESCENDING;
options.resultType = options.RESULTS_AS_URI;
if (maxItems > 0)
Expand Down

0 comments on commit 1114a56

Please sign in to comment.