开发者

Creating contextMenu at Chrome load

I'm doing a chrome extension which adds开发者_如何学Python an option to right click menu in "page" context. I see the option added in the context menu after I click on extension's icon in the toolbar.

But I need the option to be added without clicking on the extension icon in the toolbar. If I add contextMenu creation code in the content script which gets injected in every page, the option is not added in the contextmenu.

What do I need to do to: add an option in the contextMenu when the user loads any webpage without clicking the extension first.


Add your context menu in the background page. http://code.google.com/chrome/extensions/background_pages.html

Background pages is a single long-running script to manage some task or state. That is where you should put it.

Hope that helped.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜