(
self, parent: ChannelOwner, type: str, guid: str, initializer: Dict
)
| 88 | |
| 89 | class Frame(ChannelOwner): |
| 90 | def __init__( |
| 91 | self, parent: ChannelOwner, type: str, guid: str, initializer: Dict |
| 92 | ) -> None: |
| 93 | super().__init__(parent, type, guid, initializer) |
| 94 | self._parent_frame = from_nullable_channel(initializer.get("parentFrame")) |
| 95 | if self._parent_frame: |
| 96 | self._parent_frame._child_frames.append(self) |
| 97 | self._name = initializer["name"] |
| 98 | self._url = initializer["url"] |
| 99 | self._detached = False |
| 100 | self._child_frames: List[Frame] = [] |
| 101 | self._page: Optional[Page] = None |
| 102 | self._load_states: Set[str] = set(initializer["loadStates"]) |
| 103 | self._event_emitter = EventEmitter() |
| 104 | self._channel.on( |
| 105 | "loadstate", |
| 106 | lambda params: self._on_load_state(params.get("add"), params.get("remove")), |
| 107 | ) |
| 108 | self._channel.on( |
| 109 | "navigated", |
| 110 | lambda params: self._on_frame_navigated(params), |
| 111 | ) |
| 112 | |
| 113 | def __repr__(self) -> str: |
| 114 | return f"<Frame name={self.name} url={self.url!r}>" |
nothing calls this directly
no test coverage detected