Skip to content

Commit 137005d

Browse files
committed
feat: add --disable-dev-shm-usage flag to headless
This flag solves some issues when running chrome headless inside docker. For more details check this puppeteer issue where they discuss adding the flag to the default options as well: puppeteer/puppeteer#1834
1 parent 78282ac commit 137005d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ ChromeBrowser.prototype = {
167167
ChromeBrowser.$inject = ['baseBrowserDecorator', 'args']
168168

169169
function headlessGetOptions (url, args, parent) {
170-
var mergedArgs = parent.call(this, url, args).concat(['--headless', '--disable-gpu'])
170+
var mergedArgs = parent.call(this, url, args).concat([
171+
'--headless',
172+
'--disable-gpu',
173+
'--disable-dev-shm-usage'
174+
])
171175

172176
var isRemoteDebuggingFlag = function (flag) {
173177
return flag.indexOf('--remote-debugging-port=') !== -1

test/jsflags.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ describe('headlessGetOptions', function () {
6666
'-incognito',
6767
'--headless',
6868
'--disable-gpu',
69+
'--disable-dev-shm-usage',
6970
'--remote-debugging-port=9222'
7071
])
7172
})
@@ -81,7 +82,8 @@ describe('headlessGetOptions', function () {
8182
'-incognito',
8283
'--remote-debugging-port=9333',
8384
'--headless',
84-
'--disable-gpu'
85+
'--disable-gpu',
86+
'--disable-dev-shm-usage'
8587
])
8688
})
8789
})

0 commit comments

Comments
 (0)