Skip to content

Commit 7a12021

Browse files
committed
feat: add ChromiumHeadless
1 parent 96d84aa commit 7a12021

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,28 @@ ChromiumBrowser.prototype = {
264264

265265
ChromiumBrowser.$inject = ['baseBrowserDecorator', 'args']
266266

267+
var ChromiumHeadlessBrowser = function (baseBrowserDecorator, args) {
268+
ChromiumBrowser.apply(this, arguments)
269+
270+
var parentOptions = this._getOptions
271+
this._getOptions = function (url) {
272+
return headlessGetOptions.call(this, url, args, parentOptions)
273+
}
274+
}
275+
276+
ChromiumHeadlessBrowser.prototype = {
277+
name: 'ChromiumHeadless',
278+
279+
DEFAULT_CMD: {
280+
// Try chromium-browser before chromium to avoid conflict with the legacy
281+
// chromium-bsu package previously known as 'chromium' in Debian and Ubuntu.
282+
linux: getBin(['chromium-browser', 'chromium']),
283+
darwin: '/Applications/Chromium.app/Contents/MacOS/Chromium',
284+
win32: getChromiumExe()
285+
},
286+
ENV_CMD: 'CHROMIUM_BIN'
287+
}
288+
267289
var DartiumBrowser = function () {
268290
ChromeBrowser.apply(this, arguments)
269291

@@ -291,6 +313,7 @@ module.exports = {
291313
'launcher:ChromeCanary': ['type', ChromeCanaryBrowser],
292314
'launcher:ChromeCanaryHeadless': ['type', ChromeCanaryHeadlessBrowser],
293315
'launcher:Chromium': ['type', ChromiumBrowser],
316+
'launcher:ChromiumHeadless': ['type', ChromiumHeadlessBrowser],
294317
'launcher:Dartium': ['type', DartiumBrowser]
295318
}
296319

0 commit comments

Comments
 (0)