IndexedDB Updates for IE10 and Metro style apps

The Internet Explorer team along with the broader Web community has continued to make improvements to the IndexedDB specification. IndexedDB is a W3C Working Draft that enables you to store, search, and retrieve data on the user's device, even when Internet connectivity is disabled.  IndexedDB is a feature of the Web platform shared by IE10 and Metro style apps in the Windows 8 Consumer Preview.

This blog post describes changes we made in Internet Explorer 10 Consumer preview to implement the latest version of the W3C spec.

Changes to Versioning

The most significant change involves how developers update their database schemas (i.e. object stores, indexes) from one version to the next. The working group (including Microsoft) decided to replace the IDBDatabase.setVersion API with a new API. The new open API uses an additional parameter to detect if you want to use the current database version of the or if you want to update the database schema to a newer version. The open API now returns an IDBOpenDBRequest object which lets you register for the onupgradeneeded event. In the event handler you can update your database schema by adding additional object stores and indexes.

To update your existing code, add a version parameter to your open method, replacing the call to setVersion, and register a new onupgradeneeded event handler on the IDBOpenDBRequest (see below).

Old code example – green highlights the impacted code

function openDBTest(dbName) {

var rq =;

rq.onsuccess = successOpenningDB;

rq.onerror = failureHandler;



function successOpenningDB(evt) {

var db =;

var rq = db.setVersion("1");

rq.onsuccess = successHandler;

rq.onerror = failureHandler;



function successHandler(evt) {

//create schema


New code example – yellow highlights the changed code

function openDBTest(dbName) {

var rq =, 1);

rq.onsuccess = useDB;

rq.onupgradeneeded = successHandler;

rq.onerror = failureHandler;



function successHandler(evt) {

//create schema


Additional Changes

In addition, we made several smaller (but still significant) changes to the platform:

  • Added the IDBCursor.advance(count) method. This method enables you to skip records in a cursor, which in turn enables pagination scenarios. The count parameter defines the number of records you want to skip before accessing data. Valid values are 1 or greater.
  • Added the IDBObjectStore.count(key) and IDBIndex.count(key) methods. These enable you to count the records that match specific criteria. If the key value is not specified, a count of all records inside the index or the object store is returned.
  • Added the IDBFactory.cmp(first, second) method. This method compares two key values to determine if one value is greater than the other or both values are equal.
  • IDBKeyRanges now work with additional methods, including IDBObjectStore.count, IDBObjectStore.delete, IDBIndex.count. This allows you to match records that span groups of key values.
  • Values being added to the database needed no longer need to satisfy all previously defined indexes. This allows you to add records to an IDBObjectStore that fall outside the limits of previously defined indexes.
  • If an exception is thrown within the context of an active transaction, the transaction is aborted. This implies that if an exception is thrown within the onsuccess event handler of any request, the active transaction will be aborted. However, handling the exception will allow the database transaction to continue as normal.

    // This won’t abort the transaction because there is no active transaction.

    function createTransaction() {

    var txn = db.transaction("test");




    // This will abort the transaction because the exception is thrown when there is an active transaction.

    var rq = objectStore.add(record);

    rq.onsuccess = function (event) {



  • Added support to index properties on a Blob. This allows you to download binary data from the Web, store it locally, and use blob properties (e.g. name, size, etc.) as indexes or unique keys into the blob. This functionality enables scenarios like offline listening of your music collection or viewing of images and videos, while having the ability to search through your collection using the blob’s name. Our latest IE Test drive demo shows you how you can use this functionality to view your Facebook albums offline.
  • Screen shot of the IE Test Drive demo Facebook Companion
    Screen shot of IE Test Drive demo Facebook Companion

We also submitted over 100 test cases to the W3C working group for IndexedDB, including new tests and updates to existing tests.

Controlling How Sites and Apps use IndexedDB

In addition to updates to match changes in the W3C specification, the Windows 8 Consumer Preview includes improvements that allow users to remain in control of how sites and apps use IndexedDB on their devices:

  • Introduced an uninstall handler for Metro style apps that use indexedDB. This handler ensures that any time end-users remove an application, the related data in the app’s IndexedDB database will be automatically deleted during the uninstall process.
  • Implemented a quotas (storage limits) to prevent sites from exhausting disk space. Quota limits can be updated by IT Admins via group policy settings or by users with administrative access to the Registry. However, quotas don’t apply to Metro style apps.
  • Added a new browser interface for end-users to manage their databases and manage quotas. Users can use the Caches and databases dialog to remove individual databases. Alternatively, you can remove all databases using the Delete Browsing History dialog to select the “Cookies and Web site data” checkbox.

Screen shot of the new Caches and databases tab of the Website Data Settings dialog. This allows you to control whether websites may create caches and databases and how large those caches and databases may be.Screen shot of the updated Delete Browsing History dialog showing the new wording of the Cookies option to include web site data, specifically databases created by Web sites.
Screen shots of the new Caches and databases tab of the Website Data Settings dialog and the updated Delete Browsing History dialog

Looking Ahead

The W3C WebApp Working Group continues to drive IndexedDB to completion by making important improvements and reducing the number and scope of changes made to the spec.  This is an important step for Web developers building on this technology in the near future, including in Windows 8 and IE10.

We look forward to seeing how you use IndexedDB in your sites and apps, and welcome your feedback on IndexedDB in IE10.

—Israel Hilerio, Ph.D., Principal Program Manager, Internet Explorer

Comments (15)

  1. tommi says:

    We are looking forward to a preview of IE 10 for Windows 7

  2. Xero says:

    About the Quick-Tabs (Ctrl+Q) )feature of IE7,8,9&10(desktop)… Its an amazing feature but unfortunately its disabled by default! Too bad a great feature is burried deep down. Please enable it by default and it would be very wonderful if we can see CPU/Memory usage for each tab in QuickTab  and drag drop support to enhance the group management in IE 10 desktop! Drag drop in QuickTabs view can help changing the tab group. Also dragging the mouse while holding click can select multiple tabs (also pressing ctrl and click to select random tab) in that view so we can perform some actions like “assign group ”, “close tabs” and since so forth. This may improve the user experience for desktop version.

  3. Parashuram says:

    More examples to explore the IndexedDB API in IE10 HTTP:\nparashuram.comIndexeddb.  Updated to showcase the API in IE10 also.

  4. Mike says:

    Will IE10 be available for windows vista?

  5. I require to get the Internet Explorer 10 to Windows Vista! ;(

  6. Brian says:

    @Mike, Labratoria

    IE10 is not going to be available for Vista

  7. John says:

    How come FF and Chrome are available from XP and above, and MS doesn't allow their own latest browsers to run on their own legacy OSes??

  8. javascript database says:

    please Microsoft, donate an draft of linq extensions to ecma. Please propose linq extensions to javasceript (may be in ES6/hamony or es7 ???) .

    IndexDB is so… ugly….  

  9. Xero says:

    Can anyone post the complete result of when rendered on IE10 consumer's preview? Please paste it on and send us the link. Thank you!

  10. Minhaz says:


    you need to download windows8 yourself and try all sorts of goodness that comes with it……/iso

    ././|//D0S  FTW!

    M for Microsoft, Metallica & nothing else matters !!

  11. Person says:

    Needs tab reording

  12. @Xero says:

    Why would we include a so-called test that is skewed, has a creative weight distribution of implemented features, tests for functions that are not included in the specs and really doesn't test functions at all, but merely only asks.

    Yes, I'm trolling. Still, I had to get this off my chest.

  13. phil says:

    "Added support to index properties on a Blob."

    So does this mean we can now have JSON objects in the store and set indicies like ""?

Skip to main content