MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / tab_close_last_opened

Method tab_close_last_opened

seleniumbase/undetected/cdp.py:95–105  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 return resp.json()
94
95 def tab_close_last_opened(self):
96 sessions = self.tab_list()
97 opentabs = [s for s in sessions if s["type"] == "page"]
98 with requests.Session() as session:
99 endp_close = self.endpoints["close"]
100 resp = session.post(
101 self.server_addr + endp_close.format(id=opentabs[-1]["id"]),
102 headers={"Connection": "close"},
103 timeout=2,
104 )
105 return resp.json()
106
107 async def send(self, method, params):
108 self._reqid += 1

Callers

nothing calls this directly

Calls 2

tab_listMethod · 0.95
postMethod · 0.45

Tested by

no test coverage detected