简体   繁体   English

在网页/应用程序和浏览器扩展之间通信

[英]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.

相关问题 如何在 safari 应用程序和从 safari 应用程序扩展资源文件夹加载的 html 页面之间进行通信 - how to communicate between safari app and html page loaded from safari app extension resources folder 如何在Web App和C Sharp之间进行通信 - How to Communicate Between Web App and C Sharp 服务器端的python脚本与网络浏览器中的javascript之间进行通信 - communicate between python script on server side and javascript in the web-browser 特定网页与chrome扩展之间的通信 - Communication between specific web page and chrome extension 在使用 manifest v3 的浏览器扩展中,如何在内容脚本和开发工具面板之间进行通信? - In a browser extension using manifest v3, how can I communicate between a content script and a devtools panel? web 应用程序和 chrome 扩展程序之间的消息传递 - Messaging between web app and chrome extension 通过浏览器扩展查看网络设备并与之通信 - View and communicate with network devices through browser extension 在后台上下文中的脚本之间进行通信(后台脚本,浏览器操作,页面操作,选项页面等) - Communicate between scripts in the background context (background script, browser action, page action, options page, etc.) Android应用程序与Web浏览器之间的套接字通信 - Socket communication between Android app and web browser 通过浏览器扩展程序在网络上每个页面的顶部插入一个栏 - Inserting a bar on top of every page on the web through browser extension
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM