Question

Since Opera no longer implements the shortcut "/." to visit slashdot.org, I thought to write an extension that replaces that functionality.

I have not previously written an Opera extension, so I hit the docs.

Setting up an omnibox extension doesn't work, because it requires the user to put a space after the keyword.

As "/." isn't a valid URL, I'm not seeing an obvious way to intercept it.

My issue boils down to "how do I get the text before Opera assumes the user is trying to do a keyword search?"

Was it helpful?

Solution

"/." is valid url, but this is not working in Opera. This is bug which should be fixed soon. But still you will have to wait until user will put space and the start typing text to omnibox. Event onInputStarted is the earliest event you can catch. I tried

chrome.omnibox.onInputStarted.addListener(function () {
    chrome.tabs.create({url:"http://slashdot.org"});
})

and browser create tab after user type first letter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top