使用 nodejs 进行 chrome 扩展
make chrome extension using nodejs
问题背景
We are building Chrome Extension. and we need to get the python code in the process.
我所知道的
- I know that python code can be imported using Node JS.
- Node JS is used to create servers
- Chrome extension is not building server, but making programs(maybe client?)
对吗?
问题
为了实现我们的目标
- Do We need to create server with node js and communicate with chrome extension(using socket.io)?
- Is there another way to apply node js in chrome extension?
- Is there another way to get the python code into the extension?
您的 Chromium 网络扩展代码必须是纯客户端 Javascript 结构为 browser's extension environment 中的 运行。在该环境中不支持 nodejs 或 python;这是非常有限的。因为 cybercreeps.
您可以在扩展代码中使用 XmlHttpRequest 或 fetch 操作来访问网络服务。您的扩展程序清单需要 grant permission 才能访问您的服务器。
您可以通过构建和托管服务器供您的扩展程序使用来满足您的要求。你可以使用nodejs和expressand/orsocket.io这样的框架,也可以使用python、python-socketio, and a framework like Flask or Django. If you build your server with python, it probably will perform better than a nodejs serves that spawns child processes到运行python。安装、调试、维护肯定会更方便。
问题背景
We are building Chrome Extension. and we need to get the python code in the process.
我所知道的
- I know that python code can be imported using Node JS.
- Node JS is used to create servers
- Chrome extension is not building server, but making programs(maybe client?)
对吗?
问题
为了实现我们的目标
- Do We need to create server with node js and communicate with chrome extension(using socket.io)?
- Is there another way to apply node js in chrome extension?
- Is there another way to get the python code into the extension?
您的 Chromium 网络扩展代码必须是纯客户端 Javascript 结构为 browser's extension environment 中的 运行。在该环境中不支持 nodejs 或 python;这是非常有限的。因为 cybercreeps.
您可以在扩展代码中使用 XmlHttpRequest 或 fetch 操作来访问网络服务。您的扩展程序清单需要 grant permission 才能访问您的服务器。
您可以通过构建和托管服务器供您的扩展程序使用来满足您的要求。你可以使用nodejs和expressand/orsocket.io这样的框架,也可以使用python、python-socketio, and a framework like Flask or Django. If you build your server with python, it probably will perform better than a nodejs serves that spawns child processes到运行python。安装、调试、维护肯定会更方便。