• Stars
    star
    196
  • Rank 198,553 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sloth - an extension slowing down page loading to bring real user experience

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

More Repositories

1

psi-ngrok

PageSpeed Insights with local server
JavaScript
28
star
2

marionette-cli

CLI for MarionetteJS
JavaScript
22
star
3

mobile-friendly

Mobile-Friendly API for Node.js
JavaScript
15
star
4

brunch-with-marionettejs

Marionette.js skeleton with Babel/ES6 for Brunch with Progressive Web App goodness
JavaScript
15
star
5

awesome-brunch

A list of resources for Brunch
9
star
6

sw-precache-brunch

🚀 Service Worker Precache plugin for brunch.
JavaScript
7
star
7

dev-tools-element

Inject and View DevTools Timeline trace easily.
JavaScript
7
star
8

iframe-defer-element

Iframe custom element. Makes iframe not render blocking, increases your page loading speed.
JavaScript
5
star
9

marionette-es6-brunch

Simple MarionetteJS v3 application with Brunch
JavaScript
5
star
10

wait-for-netlify-deploy-action

Action waiting for live site or preview branch to be deployed. Using pure Netlify API and minimum config.
JavaScript
4
star
11

karma-brunch

Adds karma support to brunch
JavaScript
3
star
12

jest-nunjucks

Jest processor that compiles nunjucks templates
JavaScript
3
star
13

startup-nextjs-theme

Startup Nextjs theme for Stackbit V2
JavaScript
3
star
14

imperavi-image-cropper-plugin

JavaScript
3
star
15

yii2-lazy-loading-module

Module for content lazy loading
PHP
2
star
16

backbone.marionette-plupload-module

Plupload module for marionttejs
JavaScript
2
star
17

perfplanet-demo-2021

Astro
2
star
18

webhook-action

JavaScript
2
star
19

thread-emancipator

Thread business detector
JavaScript
1
star
20

cool-aspen

Jamstack site created with Stackbit
JavaScript
1
star
21

lightouse-ci-netlify-preact

JavaScript
1
star
22

filter-labels-action

JavaScript
1
star
23

beige-chili

Jamstack site created with Stackbit
JavaScript
1
star
24

gatsby-cloud-test

Gatsby starter for a Contentful project from the community.
JavaScript
1
star
25

preact-netlify

JavaScript
1
star
26

add-project-to-repo

Easiest way to add existing project or files into repository
JavaScript
1
star
27

maroon-rabbit-13e3f

Jamstack site created with Stackbit
HTML
1
star
28

magical-avocado

Jamstack site created with Stackbit
JavaScript
1
star
29

important-neptune

Jamstack site created with Stackbit
JavaScript
1
star
30

smiling-potato

Jamstack site created with Stackbit
JavaScript
1
star
31

gatsby-ecommerce-theme

JavaScript
1
star
32

atom-marionettejs-cli

MarionetteJS CLI package for Atom
CoffeeScript
1
star
33

famous-whale-13d25

Jamstack site created with Stackbit
HTML
1
star