diff --git a/toolkit/components/places/Bookmarks.jsm b/toolkit/components/places/Bookmarks.jsm index b72a59766b5b..b8091e83dff9 100644 --- a/toolkit/components/places/Bookmarks.jsm +++ b/toolkit/components/places/Bookmarks.jsm @@ -1086,6 +1086,8 @@ var Bookmarks = Object.freeze({ * This is intended as an interim API for the web-extensions implementation. * It will be removed as soon as we have a new querying API. * + * Note also that this used to exclude separators but no longer does so. + * * If you just want to search bookmarks by URL, use .fetch() instead. * * @param query @@ -1548,11 +1550,9 @@ async function handleBookmarkItemSpecialData(itemId, item) { async function queryBookmarks(info) { let queryParams = { tags_folder: await promiseTagsFolderId(), - type: Bookmarks.TYPE_SEPARATOR, }; - // We're searching for bookmarks, so exclude tags and separators. - let queryString = "WHERE b.type <> :type"; - queryString += " AND b.parent <> :tags_folder"; + // We're searching for bookmarks, so exclude tags. + let queryString = "WHERE b.parent <> :tags_folder"; queryString += " AND p.parent <> :tags_folder"; if (info.title) { diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_search.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_search.js index f21fae34143d..b91acca971c5 100644 --- a/toolkit/components/places/tests/bookmarks/test_bookmarks_search.js +++ b/toolkit/components/places/tests/bookmarks/test_bookmarks_search.js @@ -221,7 +221,7 @@ add_task(async function search_folder() { await PlacesUtils.bookmarks.eraseEverything(); }); -add_task(async function search_excludes_separators() { +add_task(async function search_includes_separators() { let bm1 = await PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid, url: "http://example.com/", title: "a bookmark" }); @@ -234,8 +234,8 @@ add_task(async function search_excludes_separators() { let results = await PlacesUtils.bookmarks.search({}); Assert.ok(results.findIndex(bookmark => { return bookmark.guid == bm1.guid }) > -1, "The bookmark was found in the results."); - Assert.equal(-1, results.findIndex(bookmark => { return bookmark.guid == bm2.guid }), - "The separator was excluded from the results."); + Assert.ok(results.findIndex(bookmark => { return bookmark.guid == bm2.guid }) > -1, + "The separator was included in the results."); await PlacesUtils.bookmarks.eraseEverything(); });