Bookmarks Search Operators

Hello,
Iam considering introducing google mail like operators (see https://support.google.com/mail/answer/7190?hl=en) into bookmarks (library) search. They would be “firefoxy” of course: name, location, tag etc. Do you think it is a good idea? Or would you recommend some other operators set? I would also like to ask if mozilla (or other) developers arent working (or going to work) on something like this already. I would invest my effort someplace else then.
Once this first part of discussion is solved I would like to ask you for some help with start. Iam quite familiar with javascript but Iam less familiar with firefox enviroment (for the time being ;-).
BR
jzav

This topic probably belongs to development section. Could some moderator move it, please?

Hi jzav

That sounds like an interesting idea. To be clear, are you suggesting this as a feature directly for end users? So for instance, when you have the bookmarks sidebar open, you can type special keywords like url:"example" ?

And are you suggesting doing this by writing an add-on, rather than directly modifying the Firefox front-end code?

If so, then I think… high-level APIs like WebExtensions don’t (yet, and perhaps won’t ever) enable you to modify arbitrary bits of the browser UI. So if I were you, I’d experiment with this by writing a separate “better bookmark manager” WebExtension using the bookmarks API.

I think searching bookmarks by tags is not implemented yet, but there is a bug on file about it.

(FWIW I think there’s a lot of potential for a really good bookmark manager add-on.)

Will

1 Like

Hi Will,
I am trying to put together a list of steps on how to make something like this possible.
I need:

  1. place for users to enter their query -> for example name:firefox OR name:support -url:https (all locations that not contains string https) tag:mozilla visited:1 (1 or less) added:7 (added in last seven days) accessed:2 (accesed in last two days) folder:mozillafirefox (bookmark parent folder)
  2. means how to retrieve this query
  3. APIs which would be able to perform search
  4. APIs or means which would be able to list the results
    Regarding bookmarks sidebar I think there are no APIs available at all. The same seems to apply for location bar where the results could be (maybe) listed using search suggestions engine or shown in the new library window (using page actions button?). I also forget that (bookmarks) library window uses chrome://browser/content/places/places.xul which would probably needs to be ported to html first so as webextensions addon could work with it. (Or not?)
    I do not have a problem to enter APIs requests into bugzilla but I would like to ask for help with framing the whole issue first.
    BR
    Jan Zavřel

Hi Jan

As I said, I think writing a WebExtension that modifies parts of the “native” browser UI (e.g. places.xul) is probably going to be a non-starter. If I wanted to add fancy operators for bookmarks search, I’d make it part of a “better bookmarks” add-on that provides a complete alternative to the native bookmarks manager.

So for instance, I might host its UI in a browser action popup, and make heavy use of the bookmarks API to query stored bookmarks. So I think you would need to build your UI - I don’t think you will get a WebExtensions API to modify the existing bookmarks UI.

What you could get, more likely, would be extensions to the bookmarks API to let you do things like query by tag.

Will

1 Like

Are you trying to do something like this:

https://support.mozilla.org/en-US/kb/awesome-bar-search-firefox-bookmarks-history-tabs?redirectlocale=en-US&redirectslug=awesome-bar-find-your-bookmarks-history-and-tabs#w_changing-results-on-the-fly

 Add ^ to search for matches in your browsing history.
Add * to search for matches in your bookmarks.
Add + to search for matches in pages you've tagged.
Add % to search for matches in your currently open tabs.
Add ~ to search for matches in pages you've typed.
Add # to search for matches in page titles.
Add @ to search for matches in web addresses (URLs).
Add $ to search for matches in suggestions. 

You cna search bookmarks with a certain tag by putting a + in the URL bar.

Here’s a quick addon to remind you of these shortcuts:
https://addons.mozilla.org/en-US/firefox/addon/awesomebar-power-tip/

2 Likes

Thank you for your answers. I already have javascript code ready which enables searching using operators “name:”, “-name:”, “url:” and “-url:”. (I am going to work on added, folder etc. now.)
It obtains list of all bookmarks via “browser.bookmarks.search({})” and then works with it. Results are available as array of bookmarktreenodes objects.
Since I cannot use chrome://browser/content/places/places.xul for retrieving search formula and showing results I would like to ask for help with developing decent html+css+javascript UI which can be used in browseraction popup.
I would appreciate hints how to approach this issue, maybe some refrence pages, experiences etc. It should be very places.xul like though: search box in the top, folder tree in the left pane and listview in the right. It should allow sorting by columns. Ability to choose which columns are shown (and in what order) would be a plus.
I will be grateful for any help you can provide.

@noitidart: I did not know something like this exists. It is pretty close to what I have in mind!

1 Like

I managed to overcome all the issues so you are welcome to try my new addon:
https://addons.mozilla.org/en-US/firefox/addon/at-your-command/

3 Likes