百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

sloth

> 开发工具
开源

Sloth - 一种延迟加载页面的扩展,以提升真实用户体验

199 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

Sloth - 一种延迟加载页面的扩展,以提升真实用户体验

Sloth

An extension that slowing down network and CPU and makes you experience web page performance as your real users.

Do you think that users have fast device/connection as you as developer has?

No they are not. Their devices/connections are slow! Very slooow! Sloth makes you suffer browsing the web like your real users.


Recently asked questions

How it works?

Sloth uses Chrome Devtools Protocol to slow down connection and throttle CPU.

What are the conditions?

Sloth applies 4x CPU throttling and slowing down network to 1.6Mbps - for download, 750Kbps - for upload. Interested in optional configurations - take a part in issue discussion

Why do I need it while @chrome-devtools can do the same?

Yes and no. DevTools can do it for opened tab, but you have to do a lot of manipulations to apply throttling (open dev tools, open proper tab, apply throttling etc). This extension is for lazy people, you just press one button and all URLs with same origin will have throttling. Handy isn't it?


Development

After adding new permissions commands below has to be run.

# Create private key called key.pem
2>/dev/null openssl genrsa 2048 | openssl pkcs8 -topk8 -nocrypt -out key.pem

# Generate string to be used as "key" in manifest.json (outputs to stdout)
2>/dev/null openssl rsa -in key.pem -pubout -outform DER | openssl base64 -A

# Calculate extension ID (outputs to stdout). Should be added to URL to path to extention page, aka chrome-extension://new_generate_key/popup.html
2>/dev/null openssl rsa -in key.pem -pubout -outform DER |  shasum -a 256 | head -c32 | tr 0-9a-f a-p
 

Testing

Extension is tested using puppeteer. Token was generated to rich tested extension page. It's value stored in fixtures the same as fixture for manifest.json. All other files (background.js, popup.html, popup.js) are symlinks (./extension -> ./test/fixtures)

Note: to update symlink files run: ln -s "$(pwd)"/extension/* test/fixtures/

Demo

  • npm run run-regular-site-demo
  • open http://localhost:8000/
  • npm run run-throttled-site-demo
  • open pages http://localhost:8001/, http://localhost:8001/page-2.html and apply throttling with extension for them

Watch demo here

Issues· 3 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptchrome-extensiondevtoolsproductivitysloth

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具