开发者

Is there a way to replicate the 'Wrench' menu in a Chrome Extension?

I'm pretty new to writing Chrome extensions. I've noticed that all of the extensions I've seen (both sample and useful) do not use the standard OS drop down menu when you click on them. Their popups tend to be pretty different and use stylesheets. Is there any way to have the extension popup be an actual OS menu (in the vein of the context menu API)?

If not, is there any place that has a stylesheet + javascript that replicates the look of a normal menu (I'm using OS X)? I 开发者_如何学运维know that the 'Wrench' menu that you use for changing settings has a normal looking menu. I tried looking through the source of Chromium to see whether it was implemented the same way as an extension and if it had such a stylesheet but I could not find anything.


I haven't really gotten the answer I wanted for this question so I tried to hack something together myself. The following stylesheet reasonably approximates the OS X menu. The only issues are that the font is a little too short when compared to the actual menu and the gradient is a little bit off (the OS X menu is not smooth and I don't know how to do that in CSS).

You can find my attempt here


Chrome wrench menu isn't rendered using javascript and css, it is a native GUI element of your OS, so you won't be able to find any css styles in sources.

If you want to replicate the menu look you can search for some javascript library that does that (like this), but I've never seen something that replicates GUI menu exactly even for one OS.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜