standardize arguments
This commit is contained in:
@@ -616,7 +616,8 @@ func (c *Client) SwitchToIframe(tabID, selector string, timeout int) error {
|
||||
|
||||
// SwitchToMain switches the context back to the main page
|
||||
// If tabID is empty, the current tab will be used
|
||||
func (c *Client) SwitchToMain(tabID string) error {
|
||||
// timeout is in seconds, 0 means no timeout
|
||||
func (c *Client) SwitchToMain(tabID string, timeout int) error {
|
||||
params := map[string]string{}
|
||||
|
||||
// Only include tab ID if it's provided
|
||||
@@ -624,6 +625,11 @@ func (c *Client) SwitchToMain(tabID string) error {
|
||||
params["tab"] = tabID
|
||||
}
|
||||
|
||||
// Add timeout if specified
|
||||
if timeout > 0 {
|
||||
params["timeout"] = strconv.Itoa(timeout)
|
||||
}
|
||||
|
||||
resp, err := c.SendCommand("switch-main", params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user