Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Tools for working with all sorts of browser viewports.
getBodyOffset
Gets the absolute offset of the body, relative to the document.
Useful for adjusting absolute positions to suit different body
positions.
getElementOffset
Gets the absolute offset of an element passed to it, relative to the body.
Useful for adjusting absolute positions to suit different element positions.
getMobileScaleFactor
Like getScaleFactor
, but returns 1
on devices where isDesktopSiteInMobileViewport
returns false
.
(We use this in Bugherd to scale our UI to fit mobile browsers when shown on desktop sites)
getScaleFactor
Gets the scaling factor of the current browser. This function doesn't distinguish between a mobile browser's viewport and a desktop browser with developer tools or a sidebar. For desktop compatibility, use getMobileScaleFactor
.
getScreenWidth
Returns the normalised screen width, no matter the orientation of the device, in pixels.
getViewportCoordinates
Gets the absolute offset of the current browser viewport, relative to the body.
isDesktopSiteInMobileViewport
Tests if the screen size is greater than the inner width of the window. In these cases, it is assumed that the browser is a mobile browser.
MIT (see LICENSE.md)
FAQs
Tools for working with all sorts of browser viewports
The npm package viewporter receives a total of 11 weekly downloads. As such, viewporter popularity was classified as not popular.
We found that viewporter 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
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.