WebMemex / webmemex-extension

📇 Your digital memory extension, as a browser extension
https://webmemex.org
Other
208 stars 45 forks source link

Search memory in address bar #14

Closed Treora closed 7 years ago

Treora commented 7 years ago

Two possible approaches:

  1. Use the omnibox API, like WorldBrain/Falcon. Currently only possible in Chrome|ium, and only works when the user enters a specified prefix, but it does allow to directly display results as suggestions.
  2. Define a search engine provider. If extension URLs are not supported as search providers, we can provide a fake URL, requests to which we redirect back to the extension. Downside: suggestions would probably not be supported as they seem not redirectable from the webRequest API. Also, switching default search engines is a hassle in Chrome|ium, though easier in Firefox.

Neither solution is really satisfying.

blackforestboi commented 7 years ago

Another option would be to make it like Pinboard. So if users search via the address bar they automatically land on a search engine (maybe google) and then get (the first 5) results displayed on the side or as the first results.

Also the missing API endpoint for the address bar will be resolved with the new FF53 (release 23. april). The problem then still remains for other browsers like safari or vivaldi.

Treora commented 7 years ago

Indeed an option to peg onto a user's existing web search (though, again, not really satisfying).

None of these options exclude each other, and all of them are compromises just to provide somewhat more convenient, quicker access to something that is already accessible in another way. I guess some user research may be helpful here, and whatever works suffices in the meantime.

blackforestboi commented 7 years ago

I think its best to just go with the way Falcon/WorldBrain does it right now. Accessing search it in the Omnibar with the command w+tab/space.

The code, giving inspriation for that can be found here: https://github.com/WorldBrain/Research-Engine/blob/master/src/js/background.js#L17 The functions involved:

Addition to the existing code

The first result should be a link to the full results page of the same query.

Rohanhacker commented 7 years ago

can I work on this I am a newcomer ?

blackforestboi commented 7 years ago

Yes, good one. As discussed in the call, feel free to take it on!

Rohanhacker commented 7 years ago

How does it look? screenshot from 2017-03-11 18-13-03

blackforestboi commented 7 years ago

Nice! that was quick. Looks great. As a bonus it would be great to show the visit time as well. so like 10/3/2017 3:30pm, if that is easily possible. Also it would be cool, if the first result would show something like "Show all results (10)" Whereas 10 would be the number of results that have been found and it would link to the search overview with the same query and the 10(?) results.

Does that make sense?

Treora commented 7 years ago

Nice indeed!

As a bonus it would be great to show the visit time as well. so like |10/3/2017 3:30pm|, if that is easily possible.

I suggest to use src/utils/nice-time.js for the date/time, so it shows the time for recently viewed items, and only the date for older items (its behaviour could still be tweaked). The rest of the code uses this too, making it nicely consistent.

Also it would be cool, if the first result would show something like "Show all results (10)" Whereas 10 would be the number of results that have been found and it would link to the search overview with the same query and the 10(?) results.

Good idea.

Rohanhacker commented 7 years ago

time can be easily done but I am not sure how one can modify redux store from a background script ??