def __init__(self, devtools_port): debugger_url = 'ws://localhost:%i/devtools/browser' % devtools_port self._socket = websocket.create_connection(debugger_url) self._next_request_id = 0 self._cur_socket_timeout = 0 self._thread = None self._tracing_data = []
def _Connect(self): if self._socket: return try: self._socket = websocket.create_connection(self._debugger_url) except (websocket.WebSocketException): if self._browser_backend.IsBrowserRunning(): raise exceptions.TabCrashException() else: raise exceptions.BrowserGoneException() self._cur_socket_timeout = 0 self._next_request_id = 0
def _Connect(self): if self._socket: return try: self._socket = websocket.create_connection(self._debugger_url) except (websocket.WebSocketException): if self._browser_backend.IsBrowserRunning(): raise exceptions.TabCrashException(sys.exc_info()[1]) else: raise exceptions.BrowserGoneException() self._cur_socket_timeout = 0 self._next_request_id = 0
def _Connect(self): if self._socket: return self._socket = websocket.create_connection(self._debugger_url) self._cur_socket_timeout = 0 self._next_request_id = 0