How to get the raw text from Opera's omnibox when the text is not a valid URI

StackOverflow https://stackoverflow.com/questions/22900718

  •  28-06-2023
  •  | 
  •  

سؤال

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?"

هل كانت مفيدة؟

المحلول

"/." 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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top