1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 10:13:31 +00:00

Hide dock icon, handle errors occurring on mac

This commit is contained in:
Hinton
2020-11-25 10:52:01 +01:00
parent efb7cc98ae
commit d94f441422
3 changed files with 14 additions and 634 deletions

View File

@@ -186,6 +186,14 @@ export class Main {
console.error(process.argv);
if (process.argv.some(arg => arg.indexOf('chrome-extension://') !== -1 || arg.indexOf('{') !== -1)) {
app.on('ready', () => {
app.dock.hide();
});
process.stdout.on('error', (e) => {
if (e.code === 'EPIPE') {
process.exit(0);
}
});
const proxy = new NativeMessagingProxy();
proxy.run();
} else {

View File

@@ -45,7 +45,12 @@ export default class NativeMessage {
// The next time we'll need to read the payload size is when all of the data
// of the current payload has been read (ie. data.length >= payloadSize + 4)
if (!sizeHasBeenRead()) {
payloadSize = stringData.readUInt32LE(0);
try {
payloadSize = stringData.readUInt32LE(0);
} catch (e) {
console.error(e);
return;
}
}
// If the data we have read so far is >= to the size advertised in the header,