Chrome扩展程序:点击某个HTML元素时,将选项添加到右键菜单 [英] Chrome extension: add option to right click menu when clicking certain HTML element

查看:475
本文介绍了Chrome扩展程序:点击某个HTML元素时,将选项添加到右键菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要创建一个Chrome扩展程序,当用户右键单击某个HTML元素(例如具有已知ID的DIV)时,会向右键菜单添加一个选项。

I want to create a Chrome extension that adds an option to the right click menu when the user right clicks a certain HTML element (for example a DIV with a known ID).

我会在用户在Twitter.com上右键单击推文时使用它来添加一个选项,并且该选项将调用REST服务。

I would use this to add an option when the user right clicks a tweet on Twitter.com and that option would call a REST service.

是否可以使用Chrome扩展程序?

Is this posible with a regultar Chrome extension?

推荐答案

是的,这些被称为上下文菜单。你可以在这里找到这些文档: https://developer.chrome.com/extensions/contextMenus

Yes, these are called Context Menus. You can find the docs for those here: https://developer.chrome.com/extensions/contextMenus

这篇关于Chrome扩展程序:点击某个HTML元素时,将选项添加到右键菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆