...

Source file src/github.com/playwright-community/playwright-go/console_message.go

Documentation: github.com/playwright-community/playwright-go

     1  package playwright
     2  
     3  type consoleMessageImpl struct {
     4  	channelOwner
     5  }
     6  
     7  // ConsoleMessageLocation represents where a console message was logged in the browser
     8  type ConsoleMessageLocation struct {
     9  	URL          string `json:"url"`
    10  	LineNumber   int    `json:"lineNumber"`
    11  	ColumnNumber int    `json:"columnNumber"`
    12  }
    13  
    14  func (c *consoleMessageImpl) Type() string {
    15  	return c.initializer["type"].(string)
    16  }
    17  
    18  func (c *consoleMessageImpl) Text() string {
    19  	return c.initializer["text"].(string)
    20  }
    21  
    22  func (c *consoleMessageImpl) String() string {
    23  	return c.Text()
    24  }
    25  
    26  func (c *consoleMessageImpl) Args() []JSHandle {
    27  	args := c.initializer["args"].([]interface{})
    28  	out := []JSHandle{}
    29  	for idx := range args {
    30  		out = append(out, fromChannel(args[idx]).(*jsHandleImpl))
    31  	}
    32  	return out
    33  }
    34  
    35  func (c *consoleMessageImpl) Location() ConsoleMessageLocation {
    36  	locations := ConsoleMessageLocation{}
    37  	remapMapToStruct(c.initializer["location"], &locations)
    38  	return locations
    39  }
    40  
    41  func newConsoleMessage(parent *channelOwner, objectType string, guid string, initializer map[string]interface{}) *consoleMessageImpl {
    42  	bt := &consoleMessageImpl{}
    43  	bt.createChannelOwner(bt, parent, objectType, guid, initializer)
    44  	return bt
    45  }
    46  

View as plain text