MCPcopy
hub / github.com/agent0ai/agent-zero / ensure_started

Method ensure_started

plugins/_browser/helpers/runtime.py:709–725  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

707 return Path(files.get_abs_path("tmp/browser/screenshots", self.safe_context_id))
708
709 async def ensure_started(self) -> None:
710 if self._context_is_alive():
711 return
712 if self.context:
713 await self._discard_stale_context("Browser context is stale; restarting.")
714
715 if self._start_lock is None:
716 self._start_lock = asyncio.Lock()
717
718 async with self._start_lock:
719 if self._context_is_alive():
720 return
721 if self.context:
722 await self._discard_stale_context("Browser context is stale; restarting.")
723 elif self.playwright and not self._closing:
724 await self._stop_playwright("Browser context closed; restarting Playwright.")
725 await self._start()
726
727 def _context_is_alive(self) -> bool:
728 if not self.context:

Callers 15

openMethod · 0.95
listMethod · 0.95
set_activeMethod · 0.95
stateMethod · 0.95
navigateMethod · 0.95
backMethod · 0.95
forwardMethod · 0.95
reloadMethod · 0.95
contentMethod · 0.95
detailMethod · 0.95
annotation_targetMethod · 0.95
evaluateMethod · 0.95

Calls 4

_context_is_aliveMethod · 0.95
_stop_playwrightMethod · 0.95
_startMethod · 0.95