MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / remove_handler

Method remove_handler

py/private/_script_handlers.py:366–374  ·  view source on GitHub ↗

Remove a handler; drops the session subscription with the last one.

(self, callback_id: int)

Source from the content-addressed store, hash-verified

364 return callback_id
365
366 def remove_handler(self, callback_id: int) -> None:
367 """Remove a handler; drops the session subscription with the last one."""
368 conn = self._script._conn
369 conn.remove_callback(_EventRef(self.EVENT), callback_id)
370 with self._lock:
371 removed = self._categories.pop(callback_id, None)
372 if removed is not None and not self._categories:
373 _unsubscribe_from_event(conn, self.EVENT, self._subscription_id)
374 self._subscription_id = None
375
376 def clear_handlers(self, category: str) -> None:
377 """Remove every handler registered under ``category``."""

Callers 1

clear_handlersMethod · 0.95

Calls 3

_EventRefClass · 0.85
_unsubscribe_from_eventFunction · 0.85
remove_callbackMethod · 0.45

Tested by

no test coverage detected