mcp iframe updates
This commit is contained in:
@@ -527,7 +527,8 @@ func (c *Client) TakeScreenshot(tabID, outputPath string, fullPage bool, timeout
|
||||
|
||||
// SwitchToIframe switches the context to an iframe for subsequent commands
|
||||
// If tabID is empty, the current tab will be used
|
||||
func (c *Client) SwitchToIframe(tabID, selector string) error {
|
||||
// timeout is in seconds, 0 means no timeout
|
||||
func (c *Client) SwitchToIframe(tabID, selector string, timeout int) error {
|
||||
params := map[string]string{
|
||||
"selector": selector,
|
||||
}
|
||||
@@ -537,6 +538,11 @@ func (c *Client) SwitchToIframe(tabID, selector string) error {
|
||||
params["tab"] = tabID
|
||||
}
|
||||
|
||||
// Add timeout if specified
|
||||
if timeout > 0 {
|
||||
params["timeout"] = strconv.Itoa(timeout)
|
||||
}
|
||||
|
||||
resp, err := c.SendCommand("switch-iframe", params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user