@@ -106,7 +106,7 @@ def get(self, url):
106
106
driver = self .driver
107
107
if hasattr (driver , "cdp_base" ):
108
108
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 ))
110
110
url_protocol = url .split (":" )[0 ]
111
111
safe_url = True
112
112
if url_protocol not in ["about" , "data" , "chrome" ]:
@@ -1014,12 +1014,22 @@ def reset_window_size(self):
1014
1014
self .set_window_rect (x , y , width , height )
1015
1015
self .__add_light_pause ()
1016
1016
1017
+ def open_new_window (self , url = None , switch_to = True ):
1018
+ return self .open_new_tab (url = url , switch_to = switch_to )
1019
+
1017
1020
def switch_to_window (self , window ):
1018
1021
self .switch_to_tab (window )
1019
1022
1020
1023
def switch_to_newest_window (self ):
1021
1024
self .switch_to_tab (- 1 )
1022
1025
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
+
1023
1033
def switch_to_tab (self , tab ):
1024
1034
driver = self .driver
1025
1035
if hasattr (driver , "cdp_base" ):
0 commit comments