diff --git a/src/end_processes.cmd b/src/end_processes.cmd index fecbbc54..833cc3da 100644 --- a/src/end_processes.cmd +++ b/src/end_processes.cmd @@ -15,7 +15,7 @@ if not "%php_process_id%"=="" ( ) :repeat_kill_chrome -for /f "tokens=* usebackq" %%p in (`wmic process where "caption like '%%chrome.exe%%' and commandline like '%%tagui_user_profile --remote-debugging-port=9222%%'" get processid 2^>nul ^| cut -d" " -f 1 ^| sort -nur ^| head -n 1`) do set chrome_process_id=%%p +for /f "tokens=* usebackq" %%p in (`wmic process where "caption like '%%chrome.exe%%' and commandline like '%%tagui_user_profile_ --remote-debugging-port=9222%%'" get processid 2^>nul ^| cut -d" " -f 1 ^| sort -nur ^| head -n 1`) do set chrome_process_id=%%p if not "%chrome_process_id%"=="" ( taskkill /PID %chrome_process_id% /T /F > nul 2>&1 goto repeat_kill_chrome @@ -47,4 +47,4 @@ for /f "tokens=* usebackq" %%p in (`wmic process where "executablepath like '%%\ if not "%tagui_process_id%"=="" ( taskkill /PID %tagui_process_id% /T /F > nul 2>&1 goto repeat_kill_tagui -) \ No newline at end of file +) diff --git a/src/tagui b/src/tagui index 2ab721c2..9b20e200 100755 --- a/src/tagui +++ b/src/tagui @@ -6,7 +6,7 @@ chrome_command="google-chrome" if [ -z "$1" ] then -echo "tagui v5.16: use following options and this syntax to run - ./tagui flow_filename option(s)" +echo "tagui v5.17: use following options and this syntax to run - ./tagui flow_filename option(s)" echo echo "chrome - run on visible Chrome web browser instead of invisible PhantomJS (first install Chrome)" echo "headless - run on invisible Chrome web browser instead of default PhantomJS (first install Chrome)" @@ -292,21 +292,21 @@ headless_switch=""; if [ "$tagui_web_browser" == "headless" ]; then headless_swi if [ "$tagui_data_set" -eq 1 ] || [ "$tagui_speed_mode" == false ]; then # check for which operating system and launch chrome accordingly -chrome_started="$(uname -s)"; chrome_switches="--user-data-dir=chrome/tagui_user_profile --remote-debugging-port=9222 about:blank" +chrome_started="$(uname -s)"; chrome_switches="--remote-debugging-port=9222 about:blank" if [ "$chrome_started" == "Darwin" ]; then if ! [ -f "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]; then echo "ERROR - cannot find Chrome at \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"" echo "Chrome is at a non-standard location on your macOS, raise an issue on TagUI GitHub page"; exit 1; fi chrome_process_id="$(ps x | grep remote-debugging-port=9222 | grep tagui_user_profile | grep window-size | sed -e 's/^[ ]*//' | cut -d' ' -f 1 | sort -nur | head -n 1)" if [ -n "$chrome_process_id" ]; then kill $chrome_process_id; fi -/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome $chrome_switches $window_size $headless_switch > /dev/null 2>&1 & +/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir="$TAGUI_DIR/chrome/tagui_user_profile" $chrome_switches $window_size $headless_switch > /dev/null 2>&1 & else if ! type "$chrome_command" > /dev/null; then echo "ERROR - cannot find Chrome command \"$chrome_command\"" echo "update chrome_command setting in tagui/src/tagui and make sure symlink to command is created"; exit 1; fi chrome_process_id="$(ps x | grep remote-debugging-port=9222 | grep tagui_user_profile | grep window-size | sed -e 's/^[ ]*//' | cut -d' ' -f 1 | sort -nur | head -n 1)" if [ -n "$chrome_process_id" ]; then kill $chrome_process_id; fi -$chrome_command $chrome_switches $window_size $headless_switch > /dev/null 2>&1 & +$chrome_command --user-data-dir="$TAGUI_DIR/chrome/tagui_user_profile" $chrome_switches $window_size $headless_switch > /dev/null 2>&1 & fi # wait until chrome is ready with websocket url for php thread diff --git a/src/tagui.cmd b/src/tagui.cmd index 9a80d1af..c109ba98 100644 --- a/src/tagui.cmd +++ b/src/tagui.cmd @@ -14,7 +14,7 @@ rem enable windows for loop advanced flow control setlocal enableextensions enabledelayedexpansion if "%~1"=="" ( -echo tagui v5.16: use following options and this syntax to run - tagui flow_filename option^(s^) +echo tagui v5.17: use following options and this syntax to run - tagui flow_filename option^(s^) echo. echo chrome - run on visible Chrome web browser instead of invisible PhantomJS ^(first install Chrome^) echo headless - run on invisible Chrome web browser instead of default PhantomJS ^(first install Chrome^) @@ -596,16 +596,17 @@ if exist "tagui_chrome.in" ( rem check for which operating system and launch chrome accordingly set chrome_started=Windows - set chrome_switches=--user-data-dir=chrome\tagui_user_profile --remote-debugging-port=9222 about:blank + set chrome_switches=--remote-debugging-port=9222 about:blank if not exist "%chrome_command%" ( - echo ERROR - cannot find Chrome at "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" + echo ERROR - cannot find Chrome at "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" + echo ERROR - or at another common folder "C:\Program Files\Google\Chrome\Application\chrome.exe" echo ERROR - or at user folder "%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe" echo update chrome_command setting in tagui\src\tagui.cmd to your chrome.exe exit /b 1 ) - for /f "tokens=* usebackq" %%p in (`wmic process where "caption like '%%chrome.exe%%' and commandline like '%%tagui_user_profile --remote-debugging-port=9222%%'" get processid 2^>nul ^| cut -d" " -f 1 ^| sort -nur ^| head -n 1`) do set chrome_process_id=%%p + for /f "tokens=* usebackq" %%p in (`wmic process where "caption like '%%chrome.exe%%' and commandline like '%%tagui_user_profile_ --remote-debugging-port=9222%%'" get processid 2^>nul ^| cut -d" " -f 1 ^| sort -nur ^| head -n 1`) do set chrome_process_id=%%p if not "!chrome_process_id!"=="" taskkill /PID !chrome_process_id! /T /F > nul 2>&1 - start "" "%chrome_command%" !chrome_switches! !window_size! !headless_switch! + start "" "%chrome_command%" --user-data-dir="%~dp0chrome\tagui_user_profile" !chrome_switches! !window_size! !headless_switch! :scan_ws_again rem wait until chrome is ready with websocket url for php thread @@ -635,7 +636,7 @@ if exist "tagui_chrome.in" echo finish > tagui_chrome.in rem kill chrome processes by checking which os the processes are started on if not "!chrome_started!"=="" if %tagui_speed_mode%==false ( - for /f "tokens=* usebackq" %%p in (`wmic process where "caption like '%%chrome.exe%%' and commandline like '%%tagui_user_profile --remote-debugging-port=9222%%'" get processid 2^>nul ^| cut -d" " -f 1 ^| sort -nur ^| head -n 1`) do set chrome_process_id=%%p + for /f "tokens=* usebackq" %%p in (`wmic process where "caption like '%%chrome.exe%%' and commandline like '%%tagui_user_profile_ --remote-debugging-port=9222%%'" get processid 2^>nul ^| cut -d" " -f 1 ^| sort -nur ^| head -n 1`) do set chrome_process_id=%%p if not "!chrome_process_id!"=="" taskkill /PID !chrome_process_id! /T /F > nul 2>&1 ) rem end of big loop for managing multiple data sets in datatable