Previously named: OpenNIC (enabled) omnibox
Prevent Chrome from searching the OpenNIC url you just entered. This is because Chrome doesn't (want to) recognize OpenNIC TLDs.
TODO, Pending review on Google Play store
Every time the user types in a OpenNIC domain without http://
or a path eg. /index.html
, Chrome interprets that as a search query.
It will use the default search engine listed under chrome://settings/searchEngines. We intercept the search query url before it loads eg. we get https://duckduckgo.com/?q=opennic.oss.
We then extract the query, and check if it's an OpenNIC URL. If it is, we redirect the browser to it using the webRequest API.
The giant infobar "Did you mean to go to http://opennic.oss/" can't be dismissed by the extension.
You need to use one of the 5 default search engines (Google, Bing, Yahoo, DuckDuckGo and Ecosia). Others can be added, but I'm too lazy to do so if there is no demand.
browser-polyfill.js
is copied fromwebextension-polyfill
with the commandcp node_modules/webextension-polyfill/dist/browser-polyfill.js .
- To see the console when debugging with
web-ext run
, go toabout:debugging
> This Firefox > OpenNIC redirect > Inspect > Console.