如何检测应用程序中的右键单击
我的目标是每当用户右键单击图片/文件时附加一个上下文菜单(vista 和 win7)。
我已经得到了文件部分(即,他们右键单击文件,我的菜单出现),但我无法理解在 firefox 或 ie 中右键单击时需要做什么。
每当有人在 IE 或 Firefox 中右键单击图像文件时,我都会尝试添加上下文菜单。这可能吗?
my objective is to attach a context menu (vista and win7) whenever user right clicks a picture/file.
I've got the file portion down (ie, they right click on a file and my menu shows up) but I am having trouble understanding what I would need to do in terms of right clicking in firefox or ie .
I am trying to add a context menu whenever someone right clicks on an image file in IE or firefox. is that possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果你想插入用户浏览器内部发生的事情,你可能应该编写一个浏览器扩展来做到这一点,而不是试图破解一些可怕的东西来完成你想要的事情。
If you want to plug in to what happens inside the user's browser, you should probably write a browser extension to do that, instead of trying to hack up something awful that sort of does what you want maybe.
最好的解决方案是为您的用户使用的浏览器开发一个插件,无论是 Internet Explorer、FireFox 还是 Chrome 等。
尝试创建某种 hack 只会给您的用户带来糟糕的体验,因此最好开发一些可以正常工作的东西。
这里有一些链接可以帮助您朝着正确的方向前进:
Google Chrome:http:// /www.mattcutts.com/blog/write-chrome-extension/
Mozilla FireFox:https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug-in_Development_Overview
(我似乎找不到任何适用于 Internet Explorer 的内容)
很抱歉,我无法给您明确的答案,但希望这至少应该能让你顺利进行。
The best solution would be to develop a plug-in for the browser used by your user, whether it be for Internet Explorer, FireFox or Chrome etc..
Trying to create some sort of hack will only lead to a bad experience for your user so it's better to develop something that would work properly.
Here's a few links to get you going in the right direction:
Google Chrome: http://www.mattcutts.com/blog/write-chrome-extension/
Mozilla FireFox: https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug-in_Development_Overview
(I can't seem to find any for Internet Explorer)
I'm sorry i cannot give you a definitive answer but hopefully this should get the ball rolling for you at least.
这可能吗?
否
对于浏览器:您需要为要支持的每个浏览器开发一个扩展 对于
桌面: http://www.codeproject.com/KB/cs/dateparser.aspx(忽略所有关于如何捕获日期时间的愚蠢说明)
is that possible?
NO
For Browsers: You need to develop an extension for each browser you want to support
For Desktop: http://www.codeproject.com/KB/cs/dateparser.aspx (ignore all the stupid istruction about how to catch the datetime )