From 8234cdb516aaa6f2087007d5703f00a51afffda8 Mon Sep 17 00:00:00 2001 From: ngosang Date: Fri, 8 Jan 2021 16:20:35 +0100 Subject: [PATCH] Add Chrome flag --disable-dev-shm-usage to fix crashes. resolves #45 --- src/session.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/session.ts b/src/session.ts index d29e796..3f08f17 100644 --- a/src/session.ts +++ b/src/session.ts @@ -56,7 +56,11 @@ function prepareBrowserProfile(id: string): string { export default { create: async (id: string, { cookies, oneTimeSession, userAgent, headers, maxTimeout, proxy }: SessionCreateOptions): Promise => { - let args = ['--no-sandbox', '--disable-setuid-sandbox']; + let args = [ + '--no-sandbox', + '--disable-setuid-sandbox', + '--disable-dev-shm-usage' // issue #45 + ]; if (proxy && proxy.url) { args.push(`--proxy-server=${proxy.url}`); } @@ -137,4 +141,4 @@ export default { }, get: (id: string): SessionsCacheItem | false => sessionCache[id] && sessionCache[id] || false -} \ No newline at end of file +}