Fauxbar icon indicating copy to clipboard operation
Fauxbar copied to clipboard

Firefox style search with * and ^ in the address box?

Open clarkwang opened this issue 4 years ago • 5 comments

To take most advantage of Fauxbar I enabled both "Show results from history" and "Show results from bookmarks" but quite often I'd like it to search bookmarks only since there are usually too many entries in the browsing history. So can we make it behave like Firefox's address bar?

  • If the query starts with *<space> then search bookmarks only
  • If the query starts with ^<space> then search history only

clarkwang avatar Jan 25 '22 15:01 clarkwang

Found the secret is:fav in code.

clarkwang avatar Jan 25 '22 16:01 clarkwang

Yeah, adding is:fav to the query is the only way to restrict the search to bookmarks at the moment.

Would be keen to make * and behave like Firefox as options, sure.

Definitely room for improvement within Fauxbar's Options to explain such things better.

ChrisNZL avatar Jan 25 '22 18:01 ChrisNZL

Hi ChrisNZL,

The following change works fine for me. Could you help integrate it into the repo and build a new release?

diff --git a/Fauxbar/js/fauxbar-1.js b/Fauxbar/js/fauxbar-1.js
index 73115a1..7c4fc84 100755
--- a/Fauxbar/js/fauxbar-1.js
+++ b/Fauxbar/js/fauxbar-1.js
@@ -2555,7 +2555,7 @@ function getResults(noQuery) {

                    for (var w in words) {
                        if (words[w] != "") {
-                           if (words[w].toLowerCase() == 'is:fav') {
+                           if (words[w] == '*' || words[w].toLowerCase() == 'is:fav') {
                                modifiers += ' AND type = 2 ';
                            }
                            else {

clarkwang avatar Mar 03 '22 02:03 clarkwang

Marking this issue for the upcoming 1.9 version.

If you create a pull request, I can link it properly...

But if not, your change above looks fine; I'll integrate it in due course.

(Lately, have been slowly tackling the Manifest V3 refactor, so not really keen to push a new version live until that's done. But can apply your change as I go through the list)

ChrisNZL avatar Mar 04 '22 04:03 ChrisNZL

I'd not bother making a pull request. Just integrate it. We really need this feature.

clarkwang avatar Mar 04 '22 16:03 clarkwang