Giter VIP home page Giter VIP logo

filldisk.com'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.com's People

Contributors

feross avatar mentalpower avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

filldisk.com's Issues

Does not actually fill disk with latest Google Chrome

No matter how long I run this (at nearly 10gb now) my free disk space not change. Perhaps Chrome compresses data, as the data is just 0123456789 repeated (and not pictures of cats 😿). It should use random data, then maybe it would work.

It works on Safari (11) though.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

The reclaim button doesn't work

Version 24.0.1312.56 (177594)

~/.config/chromium/Default/Local Storage
yac@deathstar % du -ch filldisk -c | tail -n 1
2.1G total

Iffy on Linux

The website and script are extremely iffy and crashes way before it even get's half way done filling up the disk, it does work however.

Providing fix?

Here is a simple quota mechanism for your visitors... handles cookies @4k, session & local storage mechs at 5mb.

function quota(t, d) {
    var l = /local|session/.test(t) ? 1024 * 1025 * 5 : 1024 * 4;
    var _t = l - unescape(encodeURIComponent(JSON.stringify(t))).length;
    if (_t <= 0) {
        return false;
    }
    return true;
}

if (!quota('local', data)) console.log('Cannot save, storage full');

Can I download big streaming data on client?

I have using sockt.io in client and receive data streaming but I can't download that. All of data is ~2GB.

Clinet

socket.on('recieve_records', function (data) {
    // data size = between 1-2 MB
    // I want save stream data
});

Can I help from your script?

Doesn't affect/work in Opera

I get a prompt after ~75MB asking if I want to allow the site to use more diskspace.

Furthermore, even if I do hit "Allow" on this prompt, it re-prompts repeatedly for each extra 10MB added to the limit.

So, unless you've manually disabled limits via about:config (which most users will never access), this can't really be considered to affect Opera realistically, unless you expect a user to click "Allow" on ~1000 consecutive prompts

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.