
Research
/Security News
10 npm Typosquatted Packages Deploy Multi-Stage Credential Harvester
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.
@cnbritain/common-js
Advanced tools
ObjectBooleanBooleanBooleanBooleanBooleanBooleanBooleanBooleanBooleanObjectCreates an object with user agent information
Kind: static property of detect
Url: http://stackoverflow.com/questions/5916900/how-can-you-detect-the-version-of-a-browser
Booleanwindow.history support
Kind: static property of detect
BooleanTouch support
Kind: static property of detect
BooleanAndroid useragent sniff
Kind: static property of detect
BooleaniOS useragent sniff
Kind: static property of detect
BooleanLinux useragent sniff
Kind: static property of detect
BooleanMacintoch useragent sniff
Kind: static property of detect
BooleanWindows useragent sniff
Kind: static property of detect
BooleanBox model support
Kind: static property of detect
BooleanHTML5 video support
Kind: static property of detect
PromiseNumber/FunctionfunctionfunctionObject*HTMLNode/BooleanHTMLNode/BooleanHTMLElement/BooleanObjectObjectNumberNumberNumberNumberBooleanBooleanBooleanBooleanBooleanBooleanBooleanBooleanPromisePromiseBooleanStringStringfunctionBoolean*Adds a class to an element
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| cls | String |
Adds an event to an element
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| type | String |
| fn | function |
Adds an event that will fire once and then remove itself
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| type | String |
| fn | function |
Adds html to a node
Kind: static method of functions
| Param | Type |
|---|---|
| node | HTMLElement |
PromiseBasic ajax function
Kind: static method of functions
| Param | Type |
|---|---|
| options | Object |
Number/FunctionClamps a value to the min and max. Also set up to allow currying.
Kind: static method of functions
| Param | Type |
|---|---|
| min | Number |
| max | Number |
| value1 | Number |
functionDebounce function, allows one function to be ran wait milliseconds after.
Kind: static method of functions
| Param | Type | Description |
|---|---|---|
| fn | function | |
| wait | Number | Number of milliseconds |
| scope | Object | |
| immediate | Boolean |
functionCreates a function that will delegate events to a selector
Kind: static method of functions
| Param | Type |
|---|---|
| selector | String |
| fn | function |
| ctx | * |
Exits fullscreen mode for the element
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
Loop over a collection and shift the item from the collection
Kind: static method of functions
| Param | Type |
|---|---|
| collection | Array |
| fn | function |
ObjectGets the elements offset. Based off of jquerys implementation
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
*Gets the event target
Kind: static method of functions
Returns: * - The target of the event
| Param | Type | Description |
|---|---|---|
| e | Object | The event information |
HTMLNode/BooleanGets the iframe element based on the window
Kind: static method of functions
| Param | Type |
|---|---|
| window | Window |
HTMLNode/BooleanGets the parent element matching the selector. If it doesn't match, returns nothing
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| selector | String |
HTMLElement/BooleanGets the previous element matching the selector. If it doesn't match, returns false
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLElement |
| selector | String |
ObjectGets the parent till the selector or the root.
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| selector | String |
ObjectGets the previous element till the selector or the root
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| selector | String |
NumberGets the scroll left of the element
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode/Window |
NumberGets the scroll top of the element
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode/Window |
NumberGets the scrollleft of the window
Kind: static method of functions
NumberGets the scrolltop of the window
Kind: static method of functions
BooleanChecks if the element has a class
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| cls | String |
BooleanhasOwnProperty that prevents contamination from the object being tested
Kind: static method of functions
| Param | Type |
|---|---|
| obj | Object |
| key | String |
BooleanChecks if the placement is in an article slot
Kind: static method of functions
| Param | Type |
|---|---|
| placement | String |
BooleanChecks if a value is defined
Kind: static method of functions
| Param | Type |
|---|---|
| value | * |
BooleanChecks if the value is an empty string
Kind: static method of functions
| Param | Type |
|---|---|
| value | * |
BooleanChecks if the placement is a header slot
Kind: static method of functions
| Param | Type |
|---|---|
| placement | String |
BooleanChecks if the placement is a splash slot
Kind: static method of functions
| Param | Type |
|---|---|
| placement | String |
BooleanChecks if win is a window element
Kind: static method of functions
| Param | Type |
|---|---|
| win | * |
PromiseLoads a script file into the page
Kind: static method of functions
| Param | Type |
|---|---|
| url | String |
| options | Object |
PromiseLoads any social scripts. Includes twitter, facebook, vine and instagram
Kind: static method of functions
BooleanInverts the value
Kind: static method of functions
| Param | Type |
|---|---|
| value | * |
Runs loadFn once the page has loaded
Kind: static method of functions
| Param | Type |
|---|---|
| loadFn | function |
Runs readyFn once the page is ready
Kind: static method of functions
| Param | Type |
|---|---|
| readyFn | function |
StringPads a number
Kind: static method of functions
| Param | Type |
|---|---|
| value | Number |
| width | Number |
| chr | String |
StringGenerates a random id
Kind: static method of functions
Removes a class from an element
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| cls | String |
Removes the element from the tree
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLElement |
Removes an event from an element
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| type | String |
| fn | function |
functionThrottles an event being fired by the threshold
Kind: static method of functions
| Param | Type | Description |
|---|---|---|
| fn | function | |
| threshhold | Number | Milliseconds to throttle by |
| scope | Object |
BooleanConverts a value to a boolean
Kind: static method of functions
| Param | Type |
|---|---|
| value | * |
Toggles a class on an element
Kind: static method of functions
| Param | Type |
|---|---|
| el | HTMLNode |
| cls | String |
*Unescapes a value from jinja
Kind: static method of functions
| Param | Type |
|---|---|
| value | * |
FAQs
Common javascripts
We found that @cnbritain/common-js 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.

Research
/Security News
Socket researchers found 10 typosquatted npm packages that auto-run on install, show fake CAPTCHAs, fingerprint by IP, and deploy a credential stealer.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authoritiesβ publishing activity, highlighting trends and transparency across the CVE ecosystem.