最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Let the user choose the keyword for my omnibox chrome extension - Stack Overflow

programmeradmin0浏览0评论

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:

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?

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:

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?

Share Improve this question edited Apr 12, 2013 at 18:11 HaNdTriX asked Apr 12, 2013 at 9:20 HaNdTriXHaNdTriX 29.8k11 gold badges81 silver badges86 bronze badges 1
  • NPAPI is for dealing with additional in-page content, not for extending/modifying browser features in general. – Georg Fritzsche Commented Apr 12, 2013 at 18:05
Add a ment  | 

3 Answers 3

Reset to default 2

This discussion has e up before and you can see an example of it here - https://code.google./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.

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 puter
  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

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.

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

发布评论

评论列表(0)

  1. 暂无评论