Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
zoom-level
Advanced tools
A comprehensive cross-browser package that allow you to determine page's and element's zoom level
This plugin allows you to detect browser's and separate element's zoom level.
It is lightweight and has no dependencies!
npm install zoom-level
# or via yarn
yarn add zoom-level
You can even include it with a standalone
<script src="https://unpkg.com/zoom-level" />
<script>
(() => {
window.zoomLevel.zoomLevel(); // 1
})();
</script>
import zoomLevel from "zoom-level";
zoomLevel(); // 1;
window.addEventListener("resize", () => {
zoomLevel(); // will return current browser's zoom level
});
Or, in case you want to detect separate element's zoom level (they can use own zoom
CSS property which stacks with browser's one);
import { elementZoomLevel } from "zoom-level";
const zoomedBlock = document.createElement("div");
zoomedBlock.style.zoom = 0.5;
zoomedBlock.style.width = "150px";
zoomedBlock.style.height = "150px";
zoomedBlock.style.margin = "32px";
zoomedBlock.style.padding = "32px";
zoomedBlock.style.background = "rgba(0,0,0,.05)";
zoomedBlock.innerText = "Lorem ipusm dolor sit amet";
document.appendChild(zoomedBlock);
elementZoomLevel(zoomedBlock); // 0.5;
window.addEventListener("resize", () => {
elementZoomLevel(zoomedBlock); // if you zoom to 200% it'll be 1
});
Sadly i have no idea how to manage testing of this package, due to there is no known ways to control browser's zoom level.
If you know how to do it - please let me know.
FAQs
A comprehensive cross-browser package that allow you to determine page's and element's zoom level
The npm package zoom-level receives a total of 33,117 weekly downloads. As such, zoom-level popularity was classified as popular.
We found that zoom-level 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.