Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@antv/g-mobile
Advanced tools
A renderer implemented with Canvas2D API in mobile environment
定义了基于 Canvas2D 的上下文,内置以下插件:
ContextRegisterPlugin
提供小程序环境下的上下文服务import { Canvas } from '@antv/g';
import { Renderer } from '@antv/g-mobile';
// 创建渲染器
const renderer = new Renderer();
// 创建画布
const canvas = new Canvas({
canvas: {
getContext: () => {
// 模拟 DOM API,返回小程序 context,它应当和 Canvas2DRenderingContext 一致
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement/getContext
return context;
},
getBoundingClientRect: () => {
// 模拟 DOM API,返回小程序 context 相对于视口的位置
// @see https://developer.mozilla.org/zh-CN/docs/Web/API/Element/getBoundingClientRect
return rect;
},
},
renderer,
//(可选)传入原本 DOM 环境下需要通过 window 获取的属性和方法,例如 dpr、rAF 等
// @see https://g-next.antv.vision/zh/docs/api/canvas#devicepixelratio
devicePixelRatio: 2,
requestAnimationFrame,
cancelAnimationFrame,
});
// 正常创建图形并添加到画布
FAQs
A renderer implemented with Canvas2D API in mobile environment
We found that @antv/g-mobile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 58 open source maintainers 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.