Skip to content

Commit f92ca9e

Browse files
add go back to original frame
1 parent 130e795 commit f92ca9e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/session/extra.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,24 @@ PublicSession.switch_to_frame = function(public, private, element_frame)
6262
return true
6363
end
6464

65+
-- Troca para um frame específico usando um elemento frame
66+
PublicSession.go_back_to_original_frame = function(public, private)
67+
68+
local result = private.fetch({
69+
url = private.url .. "/session/" .. private.session_id .. "/frame",
70+
method = "POST",
71+
http_version = "1.1",
72+
body = {
73+
id = {
74+
["element-6066-11e4-a52e-4f735466cecf"] = "nil"
75+
}
76+
}
77+
})
78+
79+
if result.status_code ~= 200 then
80+
error("Failed to switch to frame: " .. result.read_body())
81+
end
82+
83+
return true
84+
end
85+

0 commit comments

Comments
 (0)