Skip to content

Commit 1114a56

Browse files
devkevmaxauthority
authored andcommitted
Remove uriIsPrefix (no longer supported) (#655)
Fixes #664 - make history faster
1 parent a77d9ba commit 1114a56

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

common/content/bookmarks.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,9 @@ const Bookmarks = Module("bookmarks", {
737737
context.generate = function () {
738738
let [begin, end] = item.url.split("%s");
739739

740-
return history.get({ uri: window.makeURI(begin), uriIsPrefix: true }).map(function (item) {
740+
return history.get({ domain: window.makeURI(begin).host, domainIsHost: true }).filter(function (item) {
741+
return item.url.startsWith(begin);
742+
}).map(function (item) {
741743
let rest = item.url.length - end.length;
742744
let query = item.url.substring(begin.length, rest);
743745
if (item.url.substr(rest) == end && query.indexOf("&") == -1) {

common/content/history.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ const History = Module("history", {
1818
if (typeof filter == "string")
1919
filter = { searchTerms: filter };
2020

21+
try {
22+
for (let k in filter) {
23+
if (filter.hasOwnProperty(k)) {
24+
query[k] = filter[k];
25+
}
26+
}
27+
} catch (e) {
28+
// ?
29+
}
30+
2131
options.sortingMode = options.SORT_BY_DATE_DESCENDING;
2232
options.resultType = options.RESULTS_AS_URI;
2333
if (maxItems > 0)

0 commit comments

Comments
 (0)