diff --git a/extension/native-messaging-host/src/native-messaging-host.cpp b/extension/native-messaging-host/src/native-messaging-host.cpp index a00d4d0a..14593631 100644 --- a/extension/native-messaging-host/src/native-messaging-host.cpp +++ b/extension/native-messaging-host/src/native-messaging-host.cpp @@ -49,7 +49,7 @@ std::string keeweb_pipe_name() { std::cerr << "Error getting user: " << uv_err_name(err) << std::endl; } else { #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) - pipe_name = "\\\\.pipe\\keeweb-browser-" + std::string{user_info.username} + ".sock"; + pipe_name = "\\\\.\\pipe\\keeweb-browser-" + std::string{user_info.username}; #else pipe_name = std::filesystem::temp_directory_path() / ("keeweb-browser-" + std::to_string(user_info.uid) + ".sock"); diff --git a/extension/native-messaging-host/test/native-messaging-host-test.mjs b/extension/native-messaging-host/test/native-messaging-host-test.mjs index 0e58d9ba..7665809a 100644 --- a/extension/native-messaging-host/test/native-messaging-host-test.mjs +++ b/extension/native-messaging-host/test/native-messaging-host-test.mjs @@ -6,15 +6,17 @@ import childProcess from 'child_process'; import { expect } from 'chai'; describe('KeeWeb extension native module host', function () { - const hostPath = 'build/keeweb-native-messaging-host'; const extensionOrigin = 'keeweb-connect@keeweb.info'; const userInfo = os.userInfo(); let sockPath; + let hostPath; if (process.platform === 'win32') { - sockPath = `\\\\.pipe\\keeweb-browser-${userInfo.username}`; + sockPath = `\\\\.\\pipe\\keeweb-browser-${userInfo.username}`; + hostPath = 'build\\Debug\\keeweb-native-messaging-host.exe'; } else { sockPath = path.join(os.tmpdir(), `keeweb-browser-${userInfo.uid}.sock`); + hostPath = 'build/keeweb-native-messaging-host'; } let server;