[英]Communicate between a Web page/app and a Browser Extension
I have a Web App and an associated Browser Extension and I need a way of communication information from the Web App to the Extension when an action occurs in the Web App. 我有一个Web App和关联的浏览器扩展,当Web App中发生操作时,我需要一种从Web App到扩展的通讯信息。
Chrome has runtime.onMessageExternal() etc. which lets your app or extension receive and respond to messages from regular web pages. Chrome具有runtime.onMessageExternal()等,可让您的应用或扩展程序接收和响应来自常规网页的消息。 ref: https://developer.chrome.com/extensions/messaging 参考: https : //developer.chrome.com/extensions/messaging
This should meet my needs, however it isn't available in Firefox and I need a cross browser solution. 这应该可以满足我的需求,但是在Firefox中不可用,并且我需要一个跨浏览器解决方案。
Any suggestions? 有什么建议么?
You can do this with content script. 您可以使用内容脚本执行此操作。 Messaging from content script support by FF from version 50. FF从版本50开始支持内容脚本的消息传递。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.