Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
DOM helper library
npm install dom-lib --save
import { addClass } from 'dom-lib';
Class
void hasClass(Element node, String className)
void addClass(Element node, String className)
void removeClass(Element node, String className)
void toggleClass(Element node, String className)
Style
String getStyle(Element node, String property)
Object getStyle(Element node)
String getComputedStyle(Element node, String property)
Object getComputedStyle(Element node)
void removeStyle(Element node, String property)
void removeStyle(Element node, Array propertys)
void addStyle(Element node, String property, String value)
void addStyle(Element node, Object style)
Events
Function on(Element target, String eventName, Function listener, Boolean capture = false)
Function onFocus()
void off(Element target, String eventName, Function listener, Boolean capture = false)
on 和 onFocus 方法将返回一个 off 函数, 用于方便解绑事件
Query
Element activeElement()
Number getHeight(Element node, client)
Number getWidth(Element node, client)
Object getOffset(Element node)
Object getOffsetParent(Element node)
Object getPosition(Element node, offsetParent)
String getWindow(Element node)
String nodeName(Element node)
Object ownerDocument(Element componentOrElement)
Object ownerWindow(Element componentOrElement)
Boolean contains(Element context, Element node)
void scrollLeft(Element node, Number val)
void scrollTop(Element node, Number val)
0.2.3
2017-06-26
WheelHandler
translateDOMPositionXY
FAQs
DOM helper library
The npm package dom-lib receives a total of 68,661 weekly downloads. As such, dom-lib popularity was classified as popular.
We found that dom-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.