mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.17k stars 488 forks source link

[idea] an browser omnibox extension for MDN search with autocomplete #5193

Closed hanguokai closed 2 years ago

hanguokai commented 2 years ago

I read the article of How MDN’s autocomplete search works by @peterbe.

I suggest MDN could create a browser extension that can search MDN with autocomplete on browser's omnibox directly. For example, type mdn on the address bar, then type tab key, then input search term, now there are autocomplete search suggestions like MDN website search function. Developers can open a MDN doc quickly.

Ways to search MDN doc Pros and cons
Google "mdn + keywords" directly search on the address bar, then click a result link. but the autocomplete is not only for MDN
add a custom search engine directly search on the address bar, but there are no autocomplete suggestions
search on MDN website must open MDN website first, then search something
browser omnibox extension directly search on the address bar, like already on MDN website, and there are autocomplete suggestions

How to implement this extension? search-index.json + Fuse.js or FlexSearch + browser extension omnibox api. the search-index.json file can be cached locally in extension's cache storage and update every a few days.

Currently, there is few well maintained browser extensions for MDN search. There is an omnibox extension for MDN but it used google custom search api.

I am familiar with Chrome extensions and can create one for this. But for long-term maintenance, it is best to be maintained by the MDN community and published in the browser extension store by an official MDN account. For example, if search-index.json will be deprecated in the future. Also every extension store(Chrome/Edge/Firefox/Safari) need a publish account.

hanguokai commented 2 years ago

I have made this browser extension for MDN search. Source code is at my repository: https://github.com/hanguokai/mdn-search/ . It implements with search-index.json + Fuse.js + omnibox api.

It works on Chrome/Edge/Firefox. Currently, it is a manifest v2 extension and can change to manifest v3 easily. I haven't published it on any extension store yet. By the way, chrome web store only allow publish new manifest v3 extension, but omnibox api can't use in manifest v3 at present due to a fatal issue.

If MDN community would like to accept this repository, I can transfer the ownership of this repository to github.com/mdn/{e.g. browser-extension}.

hanguokai commented 2 years ago

@ddbeck

Hi Daniel, I made a browser extension that can help developers search MDN web docs quickly and efficiently. Is the MDN community willing to accept the project? It is a little project, and related to MDN website search function.

ddbeck commented 2 years ago

@hanguokai Thank you for opening this issue and your patience while I finally got around to this.

Foremost, this is quite cool! It's really neat to see this kind of work happening in the community.

Unfortunately, I don't think this is a project we can adopt at the moment. We just don't have the resources (mainly time!) to take ownership now. We've got a number of pressing projects and it's hard to say yes to taking on something new at the moment.

That said, I'd hate to see your effort go to waste. I think you should consider publishing the extension yourself. If you're still interested in transferring ownership of the project later, it may be something we could consider more closely if there was an established user base for it.

Thanks for your understanding and sharing your work with us!

hanguokai commented 2 years ago

Thank you for your reply.

We just don't have the resources (mainly time!) to take ownership now.

I don't think it will take a lot of time. I have finished this project in a few days. It is very small and stable. It requires little maintenance (almost nothing need to maintain if search-index.json doesn't change).

I'm experienced in the area of browser extensions and published many other extensions in the past. I can maintain it no matter where it belongs, so no additional human resources(time) required.

Anyway, it's not an urgent matter. Maybe I'll publish it later (after the issue is fixed).

hanguokai commented 2 years ago

I think you should consider publishing the extension yourself.

@ddbeck I have published this extension(MDN Search) on Chrome and Firefox extensions store after Chrome 102 fixed it's bug. Welcome to share it.

Source Code: https://github.com/hanguokai/mdn-search