(self, context_id: str | None)
| 291 | self._driver = driver |
| 292 | |
| 293 | def _context(self, context_id: str | None) -> str | None: |
| 294 | if context_id is None and self._driver is not None: |
| 295 | return self._driver.current_window_handle |
| 296 | return context_id |
| 297 | |
| 298 | def pin(self, function_declaration: str) -> PinnedScript: |
| 299 | """Pin a script so it runs in every new document and can be reused by ``execute()``. |