Sloth - an extension to make you suffer, browsing the web.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo add demo Mar 6, 2018
extension v0.2 Mar 6, 2018
test drop comments Mar 6, 2018
.gitignore improve gitignore Mar 3, 2018
.travis.yml improve travis Mar 6, 2018
LICENSE init Mar 2, 2018
README.md Update README.md Mar 9, 2018
package-lock.json init Mar 2, 2018
package.json add demo Mar 6, 2018

README.md

Sloth

Sloth - an extension to make you suffer, browsing the web.

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

No they are not. Their devices/connection are slow! Very slooow!


So enabling network and cpu throttling to have the same user experience.


Conditions:

  • CPU: 2x throttling

  • Network connection: 1.6Mbps - download, 750Kbps - upload

Recently asked questions

  • Question: Why do I need it while @chrome-devtools can do the same?
  • Answer: 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?

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)

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
 

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