File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const EVALUATE_TEXT = page => page.evaluate(() => document.body.innerText)
12
12
13
13
const EVALUATE_HTML = page => page . content ( )
14
14
15
- const kill = async browser => {
15
+ const killBrowser = async browser => {
16
16
await browser . close ( )
17
17
const pid = browser . process ( ) . pid
18
18
await fkill ( pid )
@@ -50,7 +50,7 @@ module.exports = ({
50
50
} )
51
51
52
52
browser . on ( 'disconnected' , async ( ) => {
53
- await kill ( )
53
+ await killBrowser ( browser )
54
54
spawnBrowser ( )
55
55
} )
56
56
@@ -94,7 +94,7 @@ module.exports = ({
94
94
const screenshot = wrapError ( require ( '@browserless/screenshot' ) )
95
95
96
96
return {
97
- kill,
97
+ kill : ( ) => killBrowser ( browser ) ,
98
98
browser,
99
99
html : evaluate ( EVALUATE_HTML ) ,
100
100
text : evaluate ( EVALUATE_TEXT ) ,
@@ -107,3 +107,4 @@ module.exports = ({
107
107
}
108
108
109
109
module . exports . devices = devices
110
+ module . exports . killBrowser = killBrowser
You can’t perform that action at this time.
0 commit comments