Chrome扩展程序:上下文菜单OnClickData [英] Chrome Extension: Context menu OnClickData

查看:195
本文介绍了Chrome扩展程序:上下文菜单OnClickData的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在浏览铬博客并且还没有找到这个问题的答案。

安装情况:用户在网页上看到链接并点击右键。然后他们点击上下文菜单项,然后扩展将抓取锚元素的id /名称。

到目前为止,我只能从元素中获取href或srcUrl。我可以解析url字符串来得到我需要的,但必须有另一种方法。 来源

解决方案

这是一个已知问题: http://crbug.com/39507 。请明星吧!建议的解决方法(请参阅crbug)跟踪最后一次右键单击的元素对我来说听起来很合理。


I have been scanning the chromium blog for sometime and have yet to find a answer to this question.

Setup situation: A user sees a link on a web page and right clicks. They then click on the context menu item and the extension will then grab the id/name of the anchor element.

So far I have only been able to pull the href or srcUrl from the element. I can parse the url string to get what I need but there has to be another way. Source

解决方案

This is a known issue: http://crbug.com/39507. Please star it! The suggested workaround (see the crbug) to keep track of the last right-clicked element sounds reasonable to me.

这篇关于Chrome扩展程序:上下文菜单OnClickData的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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