Skip to content

Commit 8b7cca4

Browse files
att
1 parent e31e667 commit 8b7cca4

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/session/constructor.lua

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)