Last active
December 5, 2019 17:18
-
-
Save Titiaiev/3b6af6383644114a98c665b2b6310bea to your computer and use it in GitHub Desktop.
work automation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const {exec} = require('child_process'); | |
const process = require('process'); | |
const USER_CHROM_PROFILE_DIRNAME = "./chrome_user_profile"; | |
const URLs_FOR_OPEN = ['google.com', 'nodejs.org']; | |
var gfg; | |
// # запуск хрома без гуи для удаленного дебага | |
// #chrome --headless --remote-debugging-port=9222 https://chromium.org | |
// список интересных флагов для хрома | |
// --incognito # серфить ананимно | |
// --disable-extensions # отключить расширения | |
// --restore-last-session # восстановить прощлую сессию | |
// --no-referrers # Отключение функции отслеживания веб-адресов по ссылкам | |
// --start-maximized | |
// # запуск рабочей директории в vscode | |
// # запуск хрома | |
const launch_VSCode_Chrome = `code ${process.cwd()} & \ | |
chrome ${URLs_FOR_OPEN.join(' ')} \ | |
--start-maximized \ | |
--disable-extensions \ | |
--user-data-dir="${USER_CHROM_PROFILE_DIRNAME}" &`; | |
exec(launch_VSCode_Chrome, (error, stdout, stderr) => { | |
if (error) { | |
console.error(`exec error: ${error}`); | |
return; | |
} | |
console.log(`stdout: ${stdout}`); | |
console.error(`stderr: ${stderr}`); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "launch_vscode_chrome", | |
"bin": "./launch_vscode_chrome.js", | |
"version": "0.0.1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment