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

Method remove_handler

py/private/_script_handlers.py:487–495  ·  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

485 return callback_id
486
487 def remove_handler(self, callback_id: int) -> None:
488 """Remove a handler; drops the session subscription with the last one."""
489 conn = self._script._conn
490 conn.remove_callback(_EventRef(self.EVENT), callback_id)
491 with self._lock:
492 removed = self._categories.pop(callback_id, None)
493 if removed is not None and not self._categories:
494 _unsubscribe_from_event(conn, self.EVENT, self._subscription_id)
495 self._subscription_id = None
496
497 def clear_handlers(self, category: str) -> None:
498 """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