private initObserver()

in src/performance/fmp.ts [68:87]


  private initObserver() {
    this.getFirstSnapShot();
    this.observer = new MutationObserver(() => {
      this.callbackCount += 1;
      const time = performance.now();
      const $body: HTMLElement = document.body;
      if ($body) {
        this.setTag($body, this.callbackCount);
      }
      this.statusCollector.push({
        time,
      });
    });
    // observe all child nodes
    this.observer.observe(document, {
      childList: true,
      subtree: true,
    });
    this.calculateFinalScore();
  }