diff --git a/src/js/search.js b/src/js/search.js index e72e99b8..e2d617a5 100644 --- a/src/js/search.js +++ b/src/js/search.js @@ -42,16 +42,11 @@ var search = (function() { }; searchedBookmarks.total = bookmarks.get().length; bookmarks.get().forEach(function(arrayItem, index) { - if (arrayItem.url != null) { - if (arrayItem.url.replace(/^https?\:\/\//i, "").replace(/\/$/, "").toLowerCase().includes(searchInput.value.toLowerCase().replace(/\s/g, ""))) { - var bookmarkDataCopy = JSON.parse(JSON.stringify(arrayItem)); - searchedBookmarks.matching.push(bookmarkDataCopy); - }; - } else if (arrayItem.name != null) { - if (arrayItem.name.toLowerCase().includes(searchInput.value.toLowerCase().replace(/\s/g, ""))) { - var bookmarkDataCopy = JSON.parse(JSON.stringify(arrayItem)); - searchedBookmarks.matching.push(bookmarkDataCopy); - }; + var matchUrl = (arrayItem.url != null) && (arrayItem.url.replace(/^https?\:\/\//i, "").replace(/\/$/, "").toLowerCase().includes(searchInput.value.toLowerCase().replace(/\s/g, ""))); + var matchName = (arrayItem.name != null) && (arrayItem.name.toLowerCase().includes(searchInput.value.toLowerCase().replace(/\s/g, ""))); + if (matchUrl || matchName) { + var bookmarkDataCopy = JSON.parse(JSON.stringify(arrayItem)); + searchedBookmarks.matching.push(bookmarkDataCopy); }; }); return searchedBookmarks; diff --git a/src/js/version.js b/src/js/version.js index 676e511c..96fcdcbc 100644 --- a/src/js/version.js +++ b/src/js/version.js @@ -1,6 +1,6 @@ var version = (function() { - var current = "3.60.0"; + var current = "3.61.0"; var compare = function(a, b) { var pa = a.split("."); diff --git a/src/manifest.json b/src/manifest.json index 1f97d1f9..efaf9807 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "name": "nightTab", "short_name": "nightTab", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", - "version": "3.60.0", + "version": "3.61.0", "manifest_version": 2, "chrome_url_overrides": { "newtab": "index.html"