@@ -106,7 +106,7 @@ def get(self, url):
106106 driver = self .driver
107107 if hasattr (driver , "cdp_base" ):
108108 driver = driver .cdp_base
109- self .page = self . loop .run_until_complete (driver .get (url ))
109+ self .loop .run_until_complete (self . page .get (url ))
110110 url_protocol = url .split (":" )[0 ]
111111 safe_url = True
112112 if url_protocol not in ["about" , "data" , "chrome" ]:
@@ -1014,12 +1014,22 @@ def reset_window_size(self):
10141014 self .set_window_rect (x , y , width , height )
10151015 self .__add_light_pause ()
10161016
1017+ def open_new_window (self , url = None , switch_to = True ):
1018+ return self .open_new_tab (url = url , switch_to = switch_to )
1019+
10171020 def switch_to_window (self , window ):
10181021 self .switch_to_tab (window )
10191022
10201023 def switch_to_newest_window (self ):
10211024 self .switch_to_tab (- 1 )
10221025
1026+ def open_new_tab (self , url = None , switch_to = True ):
1027+ if not isinstance (url , str ):
1028+ url = "about:blank"
1029+ self .loop .run_until_complete (self .page .get (url , new_tab = True ))
1030+ if switch_to :
1031+ self .switch_to_newest_tab ()
1032+
10231033 def switch_to_tab (self , tab ):
10241034 driver = self .driver
10251035 if hasattr (driver , "cdp_base" ):
0 commit comments