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

Method close

playwright/_impl/_page.py:853–867  ·  view source on GitHub ↗
(self, runBeforeUnload: bool = None, reason: str = None)

Source from the content-addressed store, hash-verified

851 )
852
853 async def close(self, runBeforeUnload: bool = None, reason: str = None) -> None:
854 self._close_reason = reason
855 if not runBeforeUnload:
856 self._close_was_called = True
857 try:
858 if self._owned_context:
859 await self._owned_context.close()
860 elif runBeforeUnload:
861 await self._channel.send("runBeforeUnload", None)
862 else:
863 await self._channel.send("close", None, {"reason": reason})
864 except Exception as e:
865 if is_target_closed_error(e) and not runBeforeUnload:
866 return
867 raise e
868
869 def is_closed(self) -> bool:
870 return self._is_closed

Callers 15

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
request_stopMethod · 0.45
save_asMethod · 0.45
test_memory_objectsFunction · 0.45
__init__Method · 0.45
mainFunction · 0.45

Calls 2

is_target_closed_errorFunction · 0.90
sendMethod · 0.45