Let the user choose the keyword for my omnibox chrome extension
Asked Answered
S

3

11

I just created a chrome extension using the omnibox api.

"omnibox": { "keyword" : "a" },

I found out that it is not possible to use multible keywords or let the user choose a keyword for my extension although the extension is listed on the search engines settings page:

Chrome extension Bug

I addition to that the priority of the extension keyword is by far the lowest. If a User already defined a keyword in the Default search engines / Other search engines - sections the extension keyword is not usable.

Does anyone know a solution for at least one of these issues?

Maybe by using the NPAPI?

Strictly answered 12/4, 2013 at 9:20 Comment(1)
NPAPI is for dealing with additional in-page content, not for extending/modifying browser features in general.Puncture
O
1

I'd like to let people know that it appears that this has changed and is no longer the case. I was exploring this possibility myself and found this page stating it wasn't possible. In order to change the keyword for my extension after installation I took the following steps:

  1. Right click the omnibox (address bar) and select Edit Search Engines
  2. Scroll to the very bottom (optionally deleting half of the really long list of sites you'll find)
  3. Under the section for keywords for installed extensions, find the extension you wish to edit and click the keyword value to the right of it's name. There is no edit button, it will turn into an editable field.

Edit Omnibox Keyword

I am using Chrome version 30.0.1588.0 on Windows, but I am not sure how long this has been editable.

Oba answered 13/8, 2013 at 21:17 Comment(4)
I am using the latest Chrome Version for mac (28.0.1500.95) and it still doesn't work. Nevertheless in my Chrome Canary Version (30.0.1599.0 canary) the new feature is already included. Thx for reporting!Strictly
Doesn't seem to be working on Chrome for Mac (40.0.2214.93). The box appears to be read-only.Nace
follow up up a year later: Chrome 49.0.2623.87, the keywords are grayed out and not editable.Cloverleaf
Follow up years later: Chromium 83.0.4103.61, sadly NOT editable :(Amah
F
2

This discussion has come up before and you can see an example of it here - https://code.google.com/p/chromium/issues/detail?id=75890.

It seems that the reason there is only one title:keyword pair is to prevent an over abundance of key words. There also does not appear to be any support that would allow for the end user to change this pair.

Fallal answered 15/4, 2013 at 23:15 Comment(0)
G
2

For some extensions I have found it necessary to edit the extension source directly. Often this is available on GitHub or similar a repository.

  1. Clone source to a directory on your computer
  2. Open the manifest.json file in the extension's route directory. Edit or add this section:

    "omnibox": { "keyword" : "key" }

Where "key" is the keyboard shortcut key itself.

  1. In chrome, go to: chrome://extensions/
  2. Delete the old extension (careful of deleting important data if relevant)
  3. Switch on developer mode in top right of page
  4. Select Load unpacked extension... and navigate to the cloned directory
  5. Verify the extension has loaded in Chrome and works correctly
  6. It is a security risk to browse the Internet with Chrome Extensions developer mode left on. Solve this by packing the extension into a single .crx file (a type of .zip file).
  7. Delete the newly created "unpacked" extension and click Pack extension... (you can sign the file with a .pem key but this is not necessary).
  8. Switch off developer mode in top right of page
  9. Nagivate to the directory above the cloned directory
  10. Drag the .crx file produced in the packing step onto the Chrome window
  11. The new extension should now appear on the chrome://extensions/ page
  12. Verify the correct result by navigating to chrome://settings/ -> Manage search engines...
  13. At bottom of page under "Search engines added by extensions" the keyboard shortcut should be updated and extension only appears once
Garter answered 30/7, 2016 at 12:20 Comment(1)
When doing this, beware that you will no longer receive automatic updates for the extension, and that the process needs to be repeated for every new version if you wish to install it.Orpheus
O
1

I'd like to let people know that it appears that this has changed and is no longer the case. I was exploring this possibility myself and found this page stating it wasn't possible. In order to change the keyword for my extension after installation I took the following steps:

  1. Right click the omnibox (address bar) and select Edit Search Engines
  2. Scroll to the very bottom (optionally deleting half of the really long list of sites you'll find)
  3. Under the section for keywords for installed extensions, find the extension you wish to edit and click the keyword value to the right of it's name. There is no edit button, it will turn into an editable field.

Edit Omnibox Keyword

I am using Chrome version 30.0.1588.0 on Windows, but I am not sure how long this has been editable.

Oba answered 13/8, 2013 at 21:17 Comment(4)
I am using the latest Chrome Version for mac (28.0.1500.95) and it still doesn't work. Nevertheless in my Chrome Canary Version (30.0.1599.0 canary) the new feature is already included. Thx for reporting!Strictly
Doesn't seem to be working on Chrome for Mac (40.0.2214.93). The box appears to be read-only.Nace
follow up up a year later: Chrome 49.0.2623.87, the keywords are grayed out and not editable.Cloverleaf
Follow up years later: Chromium 83.0.4103.61, sadly NOT editable :(Amah

© 2022 - 2024 — McMap. All rights reserved.