Internet Explorer 上下文菜单上下文位
我正在尝试向上下文菜单添加两个新条目,一个用于图像,一个用于锚点。我使用 0x2 作为图像,使用 0x20 作为锚点,它们会正确显示,但是当存在带有链接的图像时,仅显示图像链接,它们会执行不同的操作,所以我希望这两个项目都显示出来?
I am trying to add two new entries to the context menu, one for images and one for anchors. I am using 0x2 for images 0x20 for anchors they are displayed correctly but when there is an image with a link only the image link is showed they do different things so i would like both items to show up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@Remy - 这是一个 Windows 注册表设置,用于扩展 IE 中的上下文菜单。
HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\
@Hamza
您需要将 0x20 更改为 0x22(0x2 和 0x20 之和),然后检查脚本中的“external.menuArguments.event.srcElement”属性。如果它是图像,则使用它的 src 属性(如果它是锚点扫描它的任何图像元素的子节点)。
您也可以只使用 0x1 或 0x3F 分别代表“默认”和“全部”。以下是所有可用值 -
1 = 默认值,
2 = 图像,
4 = 控制,
8 = 表格,
16 = 文本选择,
32 = 锚,
63 = 全部
(8,表格根本不起作用)
@Remy - this is a windows registry setting used to extend the Context Menu in IE.
HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\MenuExt\\
@Hamza
You'll need to change the 0x20 to 0x22 (the sum of 0x2 and 0x20) and then inspect the "external.menuArguments.event.srcElement" property in the script. If it's an image, then use it's src property if it's an anchor scan it's child nodes for any image elements.
You could also just use 0x1 or 0x3F which represet "Default" and "All" respectively. Here are all of the values available -
1 = Default,
2 = Images,
4 = Controls,
8 = Tables,
16 = Text selection,
32 = Anchor,
63 = All
(8,Tables doesn't work at all AFAIK)