GithubHelp home page GithubHelp logo

imclab / filldisk.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from feross/filldisk.com

0.0 2.0 0.0 5.22 MB

Use HTML5 localStorage to completely fill up Chrome/Safari/IE users' hard disks

Home Page: http://www.filldisk.com

Makefile 3.21% Nginx 3.18% HTML 50.57% JavaScript 43.03%

filldisk.js's Introduction

filldisk.js - Masterful trolling with HTML5 localStorage

Use HTML5 localStorage to completely fill up Chrome, Safari, and IE users' hard disks.

Check out the demo!

Info about how this works in this blog post.

Features:

  • Fills up the user's hard disk on Chrome, Safari (iOS and desktop), and IE.
  • Fills up 1 GB every 16 seconds on my Macbook Pro Retina (with solid state drive)
  • Tested with latest Chrome (25), Safari (6), IE (10).
  • For 32-bit browsers, like Chrome, the entire browser may crash before the disk is filled.
  • Does not work on Firefox, since Firefox's implementation of localStorage is smarter.
  • Includes a button to reclaim your disk space ;)

How it works

The HTML5 localStorage standard was developed to allow sites to store larger amounts of data (like 5-10 MB) than was previously allowed by cookies (like 4KB). The standard is supported in all modern browsers (Chrome, Firefox, Safari, IE, etc.).

The standard anticipated that sites might abuse this feature ;) and advised that browsers limit the total amount of storage space that each origin could use. Quoting from the HTML5 spec:

User agents should limit the total amount of space allowed for storage areas.

The current limits are:

  • 2.5 MB per origin in Google Chrome
  • 5 MB per origin in Mozilla Firefox and Opera
  • 10 MB per origin in Internet Explorer

However, what if we get clever and make lots of subdomains like 1.filldisk.com, 2.filldisk.com, 3.filldisk.com, and so on? Should we get 5MB of space per subdomain? The standard says no.

User agents should guard against sites storing data under the origins other affiliated sites, e.g. storing up to the limit in a1.example.com, a2.example.com, a3.example.com, etc, circumventing the main example.com storage limit.

A mostly arbitrary limit of five megabytes per origin is recommended.

However, Chrome, Safari, and IE currently do not implement any such storage limit. Thus, cleverly coded websites effectively have unlimited storage space on their visitor's computer.

I wrote http://www.filldisk.com as a proof-of-concept to include with the bug reports I filed. Bug reports here:

How to reclaim space (last resort)

If clicking on the "Stop the madness" button fails to give back your disk space, you can reclaim it manually (in Chrome) by going to Preferences > Show advanced settings... > Content settings > All cookies and site data... > search for "filldisk" > Remove all.

I'm less familiar with other browsers, but deleting your cookies and cache will definitely do the trick.

MIT License

Copyright (c) 2012 Feross Aboukhadijeh

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

filldisk.js's People

Contributors

feross avatar mentalpower avatar

Watchers

JT5D avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.