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

Method remove_handler

py/private/_script_handlers.py:614–621  ·  view source on GitHub ↗

Remove a handler; tears down observers with the last one.

(self, callback_id: int)

Source from the content-addressed store, hash-verified

612 return callback_id
613
614 def remove_handler(self, callback_id: int) -> None:
615 """Remove a handler; tears down observers with the last one."""
616 conn = self._script._conn
617 conn.remove_callback(_EventRef(self.EVENT), callback_id)
618 with self._lock:
619 removed = self._handlers.pop(callback_id, None)
620 if removed is not None and not self._handlers:
621 self._teardown(conn)
622
623 def clear_handlers(self) -> None:
624 """Remove every DOM mutation handler."""

Callers 1

clear_handlersMethod · 0.95

Calls 3

_teardownMethod · 0.95
_EventRefClass · 0.85
remove_callbackMethod · 0.45

Tested by

no test coverage detected