cleanup(resetStats = false) {
    this.#pendingCleanup = true;
    const success = this.#tryCleanup();

    if (resetStats && success) {
      this._stats &&= new StatTimer();
    }
    return success;
  }
Cleans up resources allocated by the page.

@param {boolean} [resetStats] - Reset page stats, if enabled.
  The default value is `false`.
@returns {boolean} Indicates if clean-up was successfully run.