如何在linux上从firefox web扩展发送本机消息到java应用程序

kh212irz  于 2021-06-29  发布在  Java
关注(0)|答案(0)|浏览(211)

我正在尝试将本机消息从web扩展发送到使用java制作的本机应用程序。
我不断得到:“extensionerror:no this native application nativeapplication”,所以我认为问题在于如何注册java本机应用程序(通过设置本机应用程序父文件夹的路径)
我的“manifest.json”:

{

"description": "Native messaging example add-on",
"manifest_version": 2,
"name": "Native messaging example",
"version": "1.0",
"icons": {
  "48": "icons/message.svg"
},

"browser_specific_settings": {
  "gecko": {
    "id": "NativeApplication@example.org",
    "strict_min_version": "50.0"
  }
},

"background": {
  "scripts": ["background.js"]
},

"browser_action": {
  "default_icon": "icons/message.svg"
},

"permissions": ["nativeMessaging"]

}

我的“nativeapplication.json”(位于java应用程序的父文件夹中):

{
"name": "NativeApplication",
"description": "Native application example",
"path": "/home/empeor/work/COLLEGE/final year project/application/NativeApplication/StartNativeApplication.sh",
"type": "stdio",
"allowed_extensions": [ "NativeApplication@example.org" ]

}
以及我的“startnativeapplication.sh”文件(也在java应用程序的父文件夹中):


# !/bin/sh

cd "/home/empeor/work/COLLEGE/final year project/application/NativeApplication/out/artifacts/NativeApplication_jar"
java -jar NativeApplication.jar

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题