
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
first-meaning-paint
Advanced tools
首次有效绘制表示当前页面最想展示给用户的元素渲染的时间点,即主元素渲染点。
First meaning paint represents the rendering time point of the element that the current page most wants to show to the user
npm i first-meaning-paint
import firstMeaningPaint from 'first-meaning-paint'; // ./es/index.js
const config = {
eleSelector: 'body', // 非必填
intervalTime: 100, // 非必填
totalTime: 2000, // 非必填
}
firstMeaningPaint(config).then((res, rej) => {
console.log('firstMeaningPaint', res)
})
或者通过script标签引入
<script src="./iife/index"></script>
<script>
firstMeaningPaint().then((res, rej) => {
console.log('firstMeaningPaint', res)
})
</script>
首屏时间的计算逻辑为,当页面元素没有变化后2s(默认值,可配置)内,元素个数变化最大的时刻与首屏所有图片最后加载完成的时刻比较,较大的即为首屏时间。
参数 | 含义 | 默认值 | 类型 | 必填 |
---|---|---|---|---|
eleSelector | 需要计算的在外层元素 | 'body' | String | 否 |
intervalTime | 轮询周期(ms) | 100 | Number | 否 |
eleSelector | 元素没有变化后的轮询时间(ms) | 2000 | Number | 否 |
# 项目目录
cd first-meaning-paint
# 安装依赖
npm install
# 启动
npm run watch
# 打包
npm run build
欢迎参与first-meaning-paint项目的开发建设和讨论。
提交 pull request 之前请先提 [Issue 讨论].
FAQs
get page first meaning paint time
We found that first-meaning-paint 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
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.