@@ -32,7 +32,6 @@ class BrowsingContext
3232 } . freeze
3333
3434 # TODO: store current window handle in bridge object instead of always calling it
35- # @rbs (Selenium::WebDriver::Remote::BiDiBridge) -> void
3635 def initialize ( bridge )
3736 @bridge = bridge
3837 @bidi = @bridge . bidi
@@ -45,7 +44,6 @@ def initialize(bridge)
4544 # @param url [String] The URL to navigate to.
4645 # @param context_id [String, NilClass] The ID of the browsing context to navigate in.
4746 # Defaults to the window handle of the current context.
48- # @rbs (String, ?context_id: nil) -> Hash[untyped, untyped]
4947 def navigate ( url , context_id : nil )
5048 context_id ||= @bridge . window_handle
5149 @bidi . send_cmd ( 'browsingContext.navigate' , context : context_id , url : url , wait : @readiness )
@@ -57,7 +55,6 @@ def navigate(url, context_id: nil)
5755 # Positive values go forwards, negative values go backwards.
5856 # @param context_id [String, NilClass] The ID of the context to traverse.
5957 # Defaults to the window handle of the current context.
60- # @rbs (Integer, ?context_id: nil) -> Hash[untyped, untyped]
6158 def traverse_history ( delta , context_id : nil )
6259 context_id ||= @bridge . window_handle
6360 @bidi . send_cmd ( 'browsingContext.traverseHistory' , context : context_id , delta : delta )
@@ -68,18 +65,16 @@ def traverse_history(delta, context_id: nil)
6865 # Defaults to the window handle of the current context.
6966 # @param [Boolean] ignore_cache Whether to bypass the cache when reloading.
7067 # Defaults to false.
71- # @rbs (?context_id: nil, ?ignore_cache: bool) -> Hash[untyped, untyped]
7268 def reload ( context_id : nil , ignore_cache : false )
7369 context_id ||= @bridge . window_handle
74- params = { context : context_id , ignore_cache : ignore_cache , wait : @readiness }
70+ params = { context : context_id , ignore_cache : ignore_cache , wait : @readiness }
7571 @bidi . send_cmd ( 'browsingContext.reload' , **params )
7672 end
7773
7874 # Closes the browsing context.
7975 #
8076 # @param [String] context_id The ID of the context to close.
8177 # Defaults to the window handle of the current context.
82- # @rbs (?context_id: String) -> void
8378 def close ( context_id : nil )
8479 context_id ||= @bridge . window_handle
8580 @bidi . send_cmd ( 'browsingContext.close' , context : context_id )
@@ -93,27 +88,23 @@ def close(context_id: nil)
9388 # Defaults to the current window handle.
9489 #
9590 # @return [String] The context ID of the created browsing context.
96- # @rbs (?type: nil, ?context_id: nil) -> String
9791 def create ( type : nil , context_id : nil )
9892 type ||= :window
9993 context_id ||= @bridge . window_handle
10094 result = @bidi . send_cmd ( 'browsingContext.create' , type : type . to_s , referenceContext : context_id )
10195 result [ 'context' ]
10296 end
10397
104- # @rbs (?context_id: nil, ?width: Integer, ?height: Integer, ?device_pixel_ratio: Float) -> void
10598 def set_viewport ( context_id : nil , width : nil , height : nil , device_pixel_ratio : nil )
10699 context_id ||= @bridge . window_handle
107- params = { context : context_id , viewport : { width :, height :} , device_pixel_ratio :}
100+ params = { context : context_id , viewport : { width :, height : } , device_pixel_ratio : }
108101 @bidi . send_cmd ( 'browsingContext.setViewport' , **params )
109102 end
110103
111- # @rbs (String, ?accept: bool, ?text: nil | String) -> void
112104 def handle_user_prompt ( context_id , accept : true , text : nil )
113105 @bidi . send_cmd ( 'browsingContext.handleUserPrompt' , context : context_id , accept : accept , text : text )
114106 end
115107
116- # @rbs (?context_id: nil) -> void
117108 def activate ( context_id : nil )
118109 context_id ||= @bridge . window_handle
119110 @bidi . send_cmd ( 'browsingContext.activate' , context : context_id )
0 commit comments