@p4d/chrome
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -1,29 +0,40 @@ | ||
const opn = require('opn') | ||
const { exec } = require('child_process') | ||
// Command to open Google chrome | ||
let cmd = [ | ||
'export DISPLAY=:0', | ||
'&&' | ||
] | ||
switch (process.platform) { | ||
case 'darwin': | ||
cmd.push('google chrome') | ||
break | ||
case 'linux': | ||
cmd.push('/usr/bin/google-chrome') | ||
break | ||
} | ||
let options = [ | ||
'--kiosk', | ||
'--incognito', | ||
// '--ignore-certificate-errors', | ||
'--start-fullscreen', | ||
'--chrome-frame', | ||
'--no-default-browser-check', | ||
'--disable-infobars', | ||
'--disable-translate', | ||
'--disable-first-run-ui', | ||
'--disable-translate', | ||
'--disable-restore-session-state', | ||
'--ignore-certificate-errors' | ||
'--disable-restore-session-state' | ||
] | ||
// Command to open Google chrome | ||
let cmd = '' | ||
switch (process.platform) { | ||
case 'darwin': | ||
cmd = 'google chrome' | ||
break | ||
case 'linux': | ||
cmd = 'google-chrome' | ||
break | ||
} | ||
options.unshift(cmd) | ||
function open (url) { | ||
opn(url, { app: options, wait: false }) | ||
exec([...cmd, url, ...options].join(' '), (err, stdout, stderr) => { | ||
if (err) { | ||
console.log(err) | ||
return | ||
} | ||
console.log('stdout: %s', stdout) | ||
console.log('stderr: %s', stderr) | ||
}) | ||
} | ||
@@ -30,0 +41,0 @@ |
{ | ||
"name": "@p4d/chrome", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "P4D command line tool to manage chrome autostart page.", | ||
@@ -15,4 +15,3 @@ "preferGlobal": true, | ||
"dependencies": { | ||
"commander": "^2.15.0", | ||
"opn": "^5.3.0" | ||
"commander": "^2.15.0" | ||
}, | ||
@@ -19,0 +18,0 @@ "keywords": [ |
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
program | ||
.version('1.0.1') | ||
.version('1.1.0') | ||
.description('P4D command line tool to manage chrome autostart page.') | ||
@@ -10,0 +10,0 @@ |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
1785
1
57
1
- Removedopn@^5.3.0
- Removedis-wsl@1.1.0(transitive)
- Removedopn@5.5.0(transitive)