MCPcopy Index your code
hub / github.com/microsoft/playwright-python / __init__

Method __init__

playwright/_impl/_browser.py:66–84  ·  view source on GitHub ↗
(
        self, parent: "BrowserType", type: str, guid: str, initializer: Dict
    )

Source from the content-addressed store, hash-verified

64 )
65
66 def __init__(
67 self, parent: "BrowserType", type: str, guid: str, initializer: Dict
68 ) -> None:
69 super().__init__(parent, type, guid, initializer)
70 self._browser_type: Optional["BrowserType"] = None
71 self._is_connected = True
72 self._should_close_connection_on_close = False
73 self._cr_tracing_path: Optional[str] = None
74
75 self._contexts: Set[BrowserContext] = set()
76 self._traces_dir: Optional[str] = None
77 self._channel.on(
78 "context",
79 lambda params: self._did_create_context(
80 cast(BrowserContext, from_channel(params["context"]))
81 ),
82 )
83 self._channel.on("close", lambda _: self._on_close())
84 self._close_reason: Optional[str] = None
85
86 def __repr__(self) -> str:
87 return f"<Browser type={self._browser_type} version={self.version}>"

Callers

nothing calls this directly

Calls 4

_did_create_contextMethod · 0.95
_on_closeMethod · 0.95
from_channelFunction · 0.90
onMethod · 0.45

Tested by

no test coverage detected