fillSrcHoles(callback) {
    if (Object.keys(this.srcHoles).length == 0) {
      callback(this);
    } else {
      var index = Object.keys(this.srcHoles)[0];
      var src = this.srcHoles[index];
      delete this.srcHoles[index];
      var serializer = this;
      fetch(src).then(function(response) {
        return response.blob();
      }).then(function(blob) {
        var reader = new FileReader();
        reader.onload = function(e) {
          serializer.html[index] = e.target.result;
          serializer.fillSrcHoles(callback);
        }
        reader.readAsDataURL(blob);
      }).catch(function(error) {
        console.log(error);
        serializer.fillSrcHoles(callback);
      });
    }
  }
/**
   * Take all of the srcHoles and create data urls for the resources, placing
   * them in |this.html|. Calls the callback when complete.
   *
   * @param {Function} callback The callback function.
   */
Take all of the srcHoles and create data urls for the resources, placing
them in |this.html|. Calls the callback when complete.

@param {Function} callback The callback function.
Take all of the srcHoles and create data urls for the resources placing them in |this . html| . Calls the callback when complete . @param { Function } callback The callback function .
fillSrcHoles(callback) {
    if (Object.keys(this.srcHoles).length == 0) {
      callback(this);
    } else {
      var index = Object.keys(this.srcHoles)[0];
      var src = this.srcHoles[index];
      delete this.srcHoles[index];
      var serializer = this;
      fetch(src).then(function(response) {
        return response.blob();
      }).then(function(blob) {
        var reader = new FileReader();
        reader.onload = function(e) {
          serializer.html[index] = e.target.result;
          serializer.fillSrcHoles(callback);
        }
        reader.readAsDataURL(blob);
      }).catch(function(error) {
        console.log(error);
        serializer.fillSrcHoles(callback);
      });
    }
  }
fillSrcHoles ( callback ) { if ( Object . keys ( this . srcHoles ) . length == 0 ) { callback ( this ) ; } else { var index = Object . keys ( this . srcHoles ) [ 0 ] ; var src = this . srcHoles [ index ] ; delete this . srcHoles [ index ] ; var serializer = this ; fetch ( src ) . then ( function ( response ) { return response . blob ( ) ; } ) . then ( function ( blob ) { var reader = new FileReader ( ) ; reader . onload = function ( e ) { serializer . html [ index ] = e . target . result ; serializer . fillSrcHoles ( callback ) ; } reader . readAsDataURL ( blob ) ; } ) . catch ( function ( error ) { console . log ( error ) ; serializer . fillSrcHoles ( callback ) ; } ) ; } }
Take all of the srcHoles and create data urls for the resources, placing
 them in |this.html|.
Take all of the srcHoles and create data urls for the resources placing them in |this . html| .