MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / WebExtension

Class WebExtension

py/selenium/webdriver/common/web_extension.py:21–48  ·  view source on GitHub ↗

A browser extension installed with `WebDriver.install_web_extension`. Wraps the identifier the browser assigned to the extension. Pass it to `WebDriver.uninstall_web_extension` to remove the extension again.

Source from the content-addressed store, hash-verified

19
20
21class WebExtension:
22 """A browser extension installed with `WebDriver.install_web_extension`.
23
24 Wraps the identifier the browser assigned to the extension. Pass it to
25 `WebDriver.uninstall_web_extension` to remove the extension again.
26 """
27
28 def __init__(self, id: str) -> None:
29 """Wrap the identifier the browser assigned to an extension.
30
31 Args:
32 id: The identifier assigned to the extension by the browser.
33 """
34 self._id = id
35
36 @property
37 def id(self) -> str:
38 """The identifier assigned to the extension by the browser."""
39 return self._id
40
41 def __eq__(self, other: object) -> bool:
42 return isinstance(other, WebExtension) and other.id == self._id
43
44 def __hash__(self) -> int:
45 return hash(self._id)
46
47 def __repr__(self) -> str:
48 return f'<{type(self).__module__}.{type(self).__name__} (id="{self._id}")>'

Calls

no outgoing calls