@@ -11,20 +11,21 @@ Session.newSession = function (private_server_props,props)
1111 selfobject .public_method_extends (PublicSession )
1212 local args = props .args
1313
14-
15- if not args then
16- args = {
17- " --disable-blink-features=AutomationControlled" ,
18- " --disable-infobars" ,
19- " --disable-notifications" ,
20- " --disable-popup-blocking" ,
21- " --disable-extensions" ,
22- " --no-sandbox" ,
23- " --ignore-certificate-errors" ,
24- " --window-size=1920,1080" ,
25- " --user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
26- }
27- end
14+
15+ local temp_dir = " /home/chromeuser/temp_chrome_" .. os.time ()
16+ args = {
17+ " --disable-blink-features=AutomationControlled" ,
18+ " --disable-infobars" ,
19+ " --disable-notifications" ,
20+ " --disable-popup-blocking" ,
21+ " --disable-extensions" ,
22+ " --no-sandbox" ,
23+ " --ignore-certificate-errors" ,
24+ " --window-size=1920,1080" ,
25+ " --user-data-dir=" .. temp_dir ,
26+ " --user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
27+ }
28+
2829
2930 local use_automation_extension = props .use_automation_extension or false
3031
@@ -50,6 +51,7 @@ Session.newSession = function (private_server_props,props)
5051 }
5152 })
5253 local body = result .read_body_json ()
54+ print (json .dumps_to_string (body ))
5355 selfobject .private .session_id = body .value .sessionId
5456 return selfobject .public
5557
0 commit comments