fix #1818: extension connection error if browser cannot be identified

pull/1838/head
antelle 2021-05-19 10:16:40 +02:00
parent c0b159d824
commit b2d67818a8
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
2 changed files with 19 additions and 13 deletions

View File

@ -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);
}

View File

@ -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