c# - C# 使用进程在 Firefox 本机消息传递中不工作但在 Chrome 中工作启动 Excel
问题描述
这是我在 c# 中的主机应用程序。
已编辑:我已将示例主机应用程序代码更改为简单代码。
class Program
{
public static void Main(string[] args)
{
System.Diagnostics.Process.Start(@"c:\sample.xls");
}
}
当我的程序使用 Firefox 扩展程序运行时,excel 没有打开。如果我使用 Chrome 扩展程序,excel 将毫无问题地打开。
这是我的Firefox扩展设置: manifest.json
{
"name": "ExcelPrint",
"description" : "ExcelPrint",
"version": "1.0",
"permissions" :[
"activeTab", "nativeMessaging", "tabs"
],
"content_scripts": [
{
"matches": [
"https://*/*",
"http://*/*"
],
"js": ["content.js"]
}
],
"background": {
"scripts": [
"background.js"
]
},
"manifest_version": 2
}
火狐:sample.excelprint.json
{
"name": "sample.excelprint",
"description": "ExcelPrint API Host",
"path": "ExcelPrint.bat",
"type": "stdio",
"allowed_extensions": [
"3042a0d1d72c86e7952c552c6984bbea99bc5f0e@temporary-addon"
]
}
这是我的Chrome扩展设置:manifest.json 与 firefox 相同
铬:sample.excelprint.json
{
"name": "sample.excelprint",
"description": "ExcelPrint API Host",
"path": "ExcelPrint.bat",
"type": "stdio",
"allowed_origins": [
"chrome-extension://ncdpaccgfgdcifdjlncninlegabfgkgl/"
]
}
需要帮助如何使用 Firefox 扩展程序打开 excel。
解决方案
推荐阅读
- excel - 如何使用 Power Query 编辑器在 Office Excel 中正确显示数据?
- python - 我正在尝试在 python 中创建一个虚拟环境,但出现错误“没有这样的文件或目录”
- php - 计算别名列的百分比
- c# - HttpPost 一个文件从 Node js 到 .net Core C#
- c++ - 两个项目之间的编码变化
- python - 将 numpy.ndarray 输出为 csr 文件
- javascript - 邮递员写信到控制台但想要 CSV?
- c++ - 如何在 std::set 中获得严格低于上限的值?
- python - 从 FITS 图像返回 WCS 时遇到问题
- javascript - 想在对象数组中使用数组键作为新属性 javascript