0

Here are my files:

manifest.json

{
    "manifest_version": 2,
    "name": "Open Cyberduck",
    "description": "This extension will open apps",
    "version": "1.0",
    "browser_action": {
        "default_icon": "icon.png",
        "default_popup": "popup.html"
    },  
    "permissions": [
        "activeTab",
        "nativeMessaging"
    ]
}

popup.html

<html>
    <body>
        <button id="mybutton">click me</button>
        <script src="popup.js"></script>
    </body>
</html>

popup.js

var button = document.getElementById("mybutton");
button.addEventListener("click", function() {
    var port = chrome.runtime.connectNative('foobar');
    console.log(port);
}, false);

fzManifest.json (host manifest)

{
    "name": "foobar",
    "description": "My Application",
    "path": "C:\\Program Files\\Cyberduck\\Cyberduck.exe",
    "type": "stdio",
    "allowed_origins": [
        "chrome-extension://ofaogbmpoachbgnfadnlefjkpnogjkpl/"
    ]
}

for registry I ran this command: REG ADD "HKCU\Software\Google\Chrome\NativeMessagingHosts\foobar" /ve /t REG_SZ /d "D:\tests\amgen\plugin\fzManifest.json" /f

Every time I click the extension button it throws this error: Unchecked runtime.lastError: Specified native messaging host not found. Stack Trace: popup.html:0 (anonymous function)

What am I doing wrong?

Cyberduck is an FTP client application.

Sumant Agnihotri
  • 510
  • 2
  • 14
  • AFAIK you don't have to specify the full path of executable in manifest file. You specify it's name only. The path to manifest file is specified in the registry, in your case `HKCU\Software\Google\Chrome\NativeMessagingHosts\foobar`. In your case that executable file should be in this directory: D:\tests\amgen\plugin\ – Asesh May 02 '20 at 13:02
  • I moved the manifest to `C:\Program Files\Cyberduck\` path. Removed the old key and generated a new key with `"D:\tests\amgen\plugin\fzManifest.json"` replaced with `C:\Program Files\Cyberduck\manifest.json`. But it's still not working. Did I get something wrong? – Sumant Agnihotri May 02 '20 at 13:43

0 Answers0