Chrome contextMenus API ContextType

走远了吗. 提交于 2019-12-03 01:15:31
Xan
  • "link", "image", "video", "audio" are more or less self-explanatory; they correspond to right-clicks on the appropriate HTML elements.
  • "editable" means a right-click in any text input element (when text is not selected, I think). It can be something obvious like <input>, <textarea> or any tag with content-editable enabled. This question may be of interest.
  • "page" means a right-click on any space on the page that is not covered by the above.
  • "all" is all of the above combined.
  • "frame" is like "all", but only for content within <iframe>s and not the parent document. (source & rationale)
  • "selection" means a right-click on a selected part of text/HTML; a text-only copy of the content will be passed to the callback, and a content script can be used to access the DOM of the selection.
  • "browser_action" and "page_action" populate your icon's context menu when using Browser Actions and/or Page Actions.
  • "launcher" only makes sense for Chrome Apps; it adds context menu entries to the App's shortcut in the App Launcher.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!