O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Limits of the storage and how to ask for more

So far we have seen several different ways to have storage and access it at the client side. All these ways gives us the option to store large amounts of data at the client side. The question arises how come there are no hacks out there that fills up the storage of all the devices?

We will see why this is not happening everywhere, at least not without some browser vulnerability. To do this, we shall create a simple case where we will store data to the browser using localStorage, as long as we are allowed by the user agent.

How to do it...

  1. We can start by creating a file called example.js, there we will generate data with size of 1 k and size of 100 k. The data for 1k can be generated by creating an array ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required