MCPcopy Create free account
hub / github.com/tebeka/selenium / AddExtension

Method AddExtension

chrome/capabilities.go:132–139  ·  view source on GitHub ↗

AddExtension adds an extension for the browser to load at startup. The path parameter should be a path to an extension file (which typically has a `.crx` file extension. Note that the contents of the file will be loaded into memory, as required by the protocol.

(path string)

Source from the content-addressed store, hash-verified

130// `.crx` file extension. Note that the contents of the file will be loaded
131// into memory, as required by the protocol.
132func (c *Capabilities) AddExtension(path string) error {
133 f, err := os.Open(path)
134 if err != nil {
135 return err
136 }
137 defer f.Close()
138 return c.addExtension(f)
139}
140
141// addExtension reads a Chrome extension's data from r, base64-encodes it, and
142// attaches it to the Capabilities instance.

Callers

nothing calls this directly

Calls 2

addExtensionMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected