See https://bugzilla.mozilla.org/show_bug.cgi?id=1735738 for reference.
return task.firstPage || 1;
      }
      var lastPageNumber = task.lastPage || 0;
      if (!lastPageNumber || lastPageNumber > task.pdfDoc.numPages) {
        lastPageNumber = task.pdfDoc.numPages;
      }
      return lastPageNumber;
    },
    _nextPage: function Driver_nextPage(task, loadError) {
      var self = this;
      var failure = loadError || "";
      var ctx;
      if (!task.pdfDoc) {
        var dataUrl = this.canvas.toDataURL("image/png");
        this._sendResult(dataUrl, task, failure, function () {
          self._log(
            "done" + (failure ? " (failed !: " + failure + ")" : "") + "\n"
          );
          self.currentTask++;
          self._nextTask();
        });
        return;
      }
      if (task.pageNum > this._getLastPageNumber(task)) {
        if (++task.round < task.rounds) {
          this._log(" Round " + (1 + task.round) + "\n");
          task.pageNum = task.firstPage || 1;
        } else {
          this.currentTask++;
          this._nextTask();