Skip to content

Allow different host executable file extension, not only .exe #13

@tansautn

Description

@tansautn

I'm developing small extension with NHM. I used .bat file for NHM entry point.

Here is log from NMD:

18:12:56:7651 - I am [z2dlp_host.proxy.bat.exe:16772], launched by [cmd:20152].
18:12:56:7661 - GetStartupInfo() says dwFlags=0x0, excludes STARTF_USESTDHANDLES; stdin=0xffffffffffffffff; stdout=0xffffffffffffffff; stderr=0xffffffffffffffff.
18:12:56:7671 - GetStdHandle() says stdin=(0x8, FileTypePipe); stdout=(0xc, FileTypePipe); stderr=(0x0, FileTypeUnknownHandleInvalid).
18:12:56:7671 - extension: chrome-extension://pedcomindcpbnadoenfgnjandcieiani/
18:12:56:7671 - parent-window: 001213bc 
18:12:56:7671 - Listening for messages...
18:12:56:7981 - Checking for D:\Z-Data\git\qt-apps\yt-2dlp-ext\native_host\z2dlp_host.bat.exe...
18:12:56:7981 - Did not find any likely nativeHost for pedcomindcpbnadoenfgnjandcieiani. If you are using this tool as a mock,
the Injector tab allows sending messages to the browser.
18:12:56:7981 - GetStdHandle() says stdin=(0x8, FileTypePipe); stdout=(0xc, FileTypePipe); stderr=(0x0, FileTypeUnknownHandleInvalid).
18:12:56:8091 - {"action":"ping"}
18:13:06:2561 - Injecting message to extension '{"example_1": "to browser", "field_2": 2, "field_3":false}'
18:13:13:5834 - Got EOF while trying to read message size from (Extension); got only 0 bytes. Disconnecting.

Here is host manifest (proxied)

{
  "name": "z2dlp_host",
  "description": "z2dlp Native Messaging Host",
  "path": "D:\\Z-Data\\git\\qt-apps\\yt-2dlp-ext\\native_host\\z2dlp_host.proxy.bat.exe",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://pedcomindcpbnadoenfgnjandcieiani/",
    "chrome-extension://edcocgnlkdijkkiebalenphmfakmmoif/"
  ],
  "allowed_extensions": ["z2dlp_ext@zuko.pro"]
}

The real path of NHM is D:\\Z-Data\\git\\qt-apps\\yt-2dlp-ext\\native_host\\z2dlp_host.bat

I also tried "path": "D:\\Z-Data\\git\\qt-apps\\yt-2dlp-ext\\native_host\\z2dlp_host.bat.proxy.exe",

but chrome give

[296:15180:0115/182248.856:WARNING:launch_context.cc(195)] Found manifest, but not the binary for native messaging host z2dlp_host. Host path specified in the manifest: D:\Z-Data\git\qt-apps\yt-2dlp-ext\native_host\z2dlp_host.bat.proxy.exe
[296:17800:0115/182248.856:INFO:CONSOLE(554)] "Native host test error: Error: Specified native messaging host not found.", source: chrome-extension://pedcomindcpbnadoenfgnjandcieiani/options/options.js (554)

Then i rename NMD to z2dlp_host.bat.proxy.exe, doing test again. We back to Did not find any likely nativeHost for situation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions