mirror of https://github.com/keeweb/keeweb
fix #1818: extension connection error if browser cannot be identified
parent
c0b159d824
commit
b2d67818a8
|
@ -306,24 +306,29 @@ async function processFirstMessageFromSocket(socket, message) {
|
|||
|
||||
let parentProcessInfo;
|
||||
try {
|
||||
parentProcessInfo = await getProcessInfo(message.ppid);
|
||||
} catch (e) {
|
||||
logger.error(`Cannot get info for PID ${message.ppid}: ${e}`);
|
||||
socket.destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.platform === 'win32' && parentProcessInfo.appName === 'cmd') {
|
||||
try {
|
||||
parentProcessInfo = await getProcessInfo(parentProcessInfo.ppid);
|
||||
parentProcessInfo = await getProcessInfo(message.ppid);
|
||||
} catch (e) {
|
||||
logger.error(
|
||||
`Cannot get info for PID ${parentProcessInfo.ppid}: ${e}, assuming cmd is the launcher`
|
||||
);
|
||||
logger.error(`Cannot get info for PID ${message.ppid}: ${e}`);
|
||||
throw e;
|
||||
}
|
||||
|
||||
if (process.platform === 'win32' && parentProcessInfo.appName === 'cmd') {
|
||||
try {
|
||||
parentProcessInfo = await getProcessInfo(parentProcessInfo.ppid);
|
||||
} catch (e) {
|
||||
logger.error(
|
||||
`Cannot get info for PID ${parentProcessInfo.ppid}: ${e}, assuming cmd is the launcher`
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
logger.warn('Cannot get process info, assuming the connection is not identified');
|
||||
}
|
||||
|
||||
appName = AppNames[parentProcessInfo.appName] ?? parentProcessInfo.appName;
|
||||
appName = parentProcessInfo
|
||||
? AppNames[parentProcessInfo.appName] ?? parentProcessInfo.appName
|
||||
: 'Unidentified browser';
|
||||
appName = appName[0].toUpperCase() + appName.substr(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ Release notes
|
|||
-------------
|
||||
##### v1.18.6 (2021-05-19)
|
||||
`-` fix #1824: saving KDBX3 files with compression disabled
|
||||
`-` fix #1818: extension connection error if browser cannot be identified
|
||||
|
||||
##### v1.18.5 (2021-05-14)
|
||||
`-` fix #1816: old Chromium support, such as Android Edge
|
||||
|
|
Loading…
Reference in New Issue