4

I want an extension to be controlled by the Omnibox. The chrome.omnibox API lets me register a keyword, but that means a lot of clicking or typing to get to the extension. For example, I have to Ctrl+L to select the omnibox, then type some letters for the extension and space/tab.

Can this "omnibox mode for my extension" be entered programmatically? I.e. is there an API call I can make that will take the user's keyboard focus to the omnibox in already switched mode to my extension? I just want to replace the sequence of clicks/typing with a single keyboard shortcut that will allow the user immediately interact with the extension via the omnibox.

Eli Bendersky
  • 263,248
  • 89
  • 350
  • 412

1 Answers1

2

This is not currently possible. I could see this being implemented in two ways: 1. As you suggest, by allowing the extension to enter omnibox programmatically. I'm not sure if that's a good idea - stealing keyboard focus could be annoying to the user, and a possible security risk. 2. By adding "enter omnibox mode" as a target for the commands API. That way the user can configure the keyboard shortcut or disable it entirely.

mpcomplete
  • 221
  • 2
  • 2
  • 1
    Thanks! I agree that (1) is not a great idea. It's definitely my intention to tie this to a keyboard shortcut, so (2) sounds great and it isn't intrusive (the user opts in by assigning a keyboard shortcut). How do I propose this as a feature request :) ? – Eli Bendersky Oct 14 '13 at 21:19