diff --git a/js/search.js b/js/search.js index 62e26e22..7d8acd89 100644 --- a/js/search.js +++ b/js/search.js @@ -55,9 +55,16 @@ var search = (function() { }; searchedBookmarks.total = bookmarks.get().length; bookmarks.get().forEach(function(arrayItem, index) { - if (arrayItem.url.replace(/^https?\:\/\//i, "").replace(/\/$/, "").toLowerCase().includes(searchInput.value.toLowerCase().replace(/\s/g, "")) || arrayItem.name.toLowerCase().includes(searchInput.value.toLowerCase().replace(/\s/g, ""))) { - var bookmarkDataCopy = JSON.parse(JSON.stringify(arrayItem)); - searchedBookmarks.matching.push(bookmarkDataCopy); + 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); + }; }; }); return searchedBookmarks; diff --git a/js/version.js b/js/version.js index 9c272adc..178d1956 100644 --- a/js/version.js +++ b/js/version.js @@ -1,6 +1,6 @@ var version = (function() { - var current = "3.16.2"; + var current = "3.16.3"; var compare = function(a, b) { var pa = a.split("."); diff --git a/manifest.json b/manifest.json index e4c29d19..e7fbeb56 100644 --- a/manifest.json +++ b/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.16.2", + "version": "3.16.3", "manifest_version": 2, "chrome_url_overrides": { "newtab": "index.html"