Your Search Results

    Using IndexedDB in chrome

    The nsIIndexedDatabaseManager was removed in Firefox 33. (Please refer to bug 1019194.)

    IndexedDB is typically used to store data in the user's browser from content JavaScript.  (See Using IndexedDB for an overview.)  But the APIs can be also be accessed from chrome via the initWindowless method of the IndexedDB manager service.

    You need simply provide an object for the service to bind to.  For example:

    let DB_NAME = "my-database";
    let STORE_NAME = "my-store";
    let dbContext = this;
    function MyService() {
      this._db = null;
    MyService.prototype = {
      open: function MyService_open(successCB, errorCB) {
        let idbManager = Components.classes[";1"]
        // Bind the service
        // From here on, it's like using IndexedDB from JavaScript content
        let req =;
        req.onupgradeneeded = function(event) {
          let db =;
          db.createObjectStore(STORE_NAME, { /* declare schema on first run */ });
        req.onerror = function() {
        req.onsuccess = function(event) {
          this._db = req.result;
      // etc ...


    Document Tags and Contributors

    Contributors to this page: evold, jedp, chrisdavidmills
    Last updated by: evold,