Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
conglomerate-dom-event
Advanced tools
Adaptation of DOM Delegate, developed by FT Labs, part of the Financial Times.
Simple, easy-to-use component for binding to events on all target elements matching the given selector, irrespective of whether anything exists in the DOM at registration time or not. This allows developers to implement the event delegation pattern.
The developers of ftdomdelegate are Matthew Andrews and Matthew Caruana Galizia. Test engineering by Sam Giles. The API is influenced by jQuery Live. All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request.
Thanks to Sauce Labs for providing the infrastructure that allows us to run our build in real browsers.
DOM event delegator
The delegator will listen for events that bubble up to the root node.
Parameters
Parameters
eventType
stringReturns **** boolean
Short hand for off() and root(), ie both with no parameters
Returns **** void
Fire a listener on a target.
Parameters
Returns boolean
Handle an arbitrary event.
Parameters
event
EventRemove an event handler for elements that match the selector, forever
Parameters
eventType
string= Remove handlers for events matching this type, considering the other parametersselector
string= If this parameter is omitted, only handlers which match the other two will be removedhandler
function ()= If this parameter is omitted, only handlers which match the previous two will be removeduseCapture
Returns Delegate This method is chainable
Attach a handler to one event for all elements that match the selector, now or in the future
The handler function receives three arguments: the DOM event object, the node that matched the selector while the event was bubbling and a reference to itself. Within the handler, 'this' is equal to the second argument.
The node that actually received the event can be accessed via 'event.target'.
Parameters
eventType
string Listen for these eventsselector
(string|undefined) Only handle events on elements matching this selector, if undefined match root elementhandler
function () Handler function - event data passed here will be in event.dataeventData
Object= Data to pass in event.datauseCapture
Returns Delegate This method is chainable
Start listening for events on the provided DOM element
Parameters
Returns Delegate This method is chainable
Maintain a map of listener lists, keyed by event name.
Check whether an element matches a generic selector.
Parameters
selector
string A CSS selectorCheck whether the ID of the element in 'this' matches the given ID.
IDs are case-sensitive.
Parameters
Returns **** boolean
Check whether an element matches the root.
Parameters
selector
?String In this case this is always passed through as null and not usedelement
Element The element to test withReturns **** boolean
Check whether an element matches a tag selector.
Tags are NOT case-sensitive, except in XML (and XML-based languages such as XHTML).
Parameters
Returns **** boolean
The root node at which listeners are attached.
conglomerate-dom-event is released under the terms of the BSD-3-Clause license.
This software includes or is derivative of works distributed under the licenses listed below. Please refer to the specific files and/or packages for more detailed information about the authors, copyright notices, and licenses.
FAQs
Create and manage a DOM event delegator.
The npm package conglomerate-dom-event receives a total of 0 weekly downloads. As such, conglomerate-dom-event popularity was classified as not popular.
We found that conglomerate-dom-event demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.