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

Method internalize_links

seleniumbase/fixtures/base_case.py:2109–2115  ·  view source on GitHub ↗

All `target="_blank"` links become `target="_self"`. This prevents those links from opening in a new tab.

(self)

Source from the content-addressed store, hash-verified

2107 self.execute_script(script)
2108
2109 def internalize_links(self):
2110 """All `target="_blank"` links become `target="_self"`.
2111 This prevents those links from opening in a new tab."""
2112 if self.__is_cdp_swap_needed():
2113 self.cdp.internalize_links()
2114 return
2115 self.set_attributes('[target="_blank"]', "target", "_self")
2116
2117 def get_parent(self, element, by="css selector", timeout=None):
2118 """Returns the parent element.

Callers

nothing calls this directly

Calls 2

__is_cdp_swap_neededMethod · 0.95
set_attributesMethod · 0.95

Tested by

no test coverage detected