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.
@claviska/jquery-offscreen
Advanced tools
Filters that detect when an element is partially or completely outside of the viewport.
Filters that detect when an element is at least partially outside of the viewport. Useful for repositioning menus, tooltips, etc. when they would otherwise appear off the screen.
$('#element').is(':off-top') // top of the viewport
$('#element').is(':off-right') // right-side of the viewport
$('#element').is(':off-bottom') // bottom of the viewport
$('#element').is(':off-left') // left-side of the viewport
$('#element').is(':off-screen') // any side of the viewport
Each filter returns true
if #element
's bottom edge is 1px or more past the specified side of the viewport.
This example will keep Bootstrap 3 dropdowns from going off the right side of the screen.
$('.dropdown').on('shown.bs.dropdown', function() {
var dropdown = $(this),
menu = dropdown.find('.dropdown-menu');
// Restore to default position
menu.removeClass('dropdown-menu-right');
// Adjust if it's off the screen
if( menu.is(':off-right') ) {
menu.addClass('dropdown-menu-right');
}
});
Copyright Cory LaViska for A Beautiful Site, LLC
License: http://opensource.org/licenses/MIT
FAQs
Filters that detect when an element is partially or completely outside of the viewport.
We found that @claviska/jquery-offscreen 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’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.