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.
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 5 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
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.