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

Method close_active_tab

seleniumbase/core/sb_cdp.py:1395–1401  ·  view source on GitHub ↗

Close the active tab. The active tab is the one currenly controlled by CDP. The active tab MIGHT NOT be the currently visible tab! (If a page opens a new tab, the new tab WON'T be active) To switch the active tab, call: sb.switch_to_tab(tab)

(self)

Source from the content-addressed store, hash-verified

1393 self.switch_to_tab(-1)
1394
1395 def close_active_tab(self):
1396 """Close the active tab.
1397 The active tab is the one currenly controlled by CDP.
1398 The active tab MIGHT NOT be the currently visible tab!
1399 (If a page opens a new tab, the new tab WON'T be active)
1400 To switch the active tab, call: sb.switch_to_tab(tab)"""
1401 return self.loop.run_until_complete(self.page.close())
1402
1403 def get_active_tab(self):
1404 """Return the active tab.

Callers 3

test_presentation_4Method · 0.80
raw_priceline.pyFile · 0.80

Calls 1

closeMethod · 0.80

Tested by 1

test_presentation_4Method · 0.64