karan / chrome-url-alias

Chrome extension to set URL aliases ("m/" goes to "mail.google.com" etc)
http://bit.ly/url-alias
Apache License 2.0
112 stars 27 forks source link

Redirect occurs after chrome shows website not found #11

Open itaditya opened 6 years ago

itaditya commented 6 years ago

It certainly decreases the productivity levels when I first have to wait for chrome to try to reach the website and because it doesn't exist then show me the error page and then takes me to my desired site.

Plus as mentioned in #4 , if I type g then it will show me github.com or other frequently visited site. If it's github then I don't need the extension. If not github.com then I'll need to clear the predicted text add a "/" and then wait.

Can anything be done to shorten the time waiting ?

cherrry commented 6 years ago

intercept all requests with chrome.webRequest.onBeforeRequest would be much faster than doing redirection upon chrome.tabs.onUpdated, but that requires <all_urls> permission.

itaditya commented 6 years ago

I fell in the rabbit hole and discovered chrome.omnibox . I guess that can be used to display custom results. without ever hijacking web requests

itaditya commented 6 years ago

I have started working on my own extension using the omnibox api, while digging I also found declarativeWebRequest which is not stable but will be hell of a lot faster because we declare only rules and everything will happen natively in the browser without us ever having to do anything on the javascript engine.