Skip to content

Commit 70cdd0c

Browse files
committed
Fix bug in Firefox interception caused by recent Snap fixes
1 parent 163ac0f commit 70cdd0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util/snap.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export async function isSnap(bin: string) {
1919
// & firefox use these. Check the end and see if we recognize it:
2020

2121
const fileSize = await fs.statFile(binPath);
22-
const stream = fs.createReadStream(binPath, { start: fileSize.size - 100 });
22+
const stream = fs.createReadStream(binPath, {
23+
start: Math.max(fileSize.size - 100, 0)
24+
});
2325
const lastChunkOfFile = (await streamToBuffer(stream)).toString('utf8');
2426

2527
return lastChunkOfFile.includes('exec /snap/bin/');

0 commit comments

Comments
 (0)