let's better test how possibly taperM can access a network something in firefox at that level and catch some "isGenerating" flag specifically in this gradio-svelte chatgpt at hf.space chat in which you now generating your generations.

```
// ==UserScript==
// @name         HF ChatGPT Generation State Composite Monitor
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Combines fetch/XHR + EventSource for robust before/while/after generation state detection on yuntian-deng-chatgpt.hf.space
// @match        https://yuntian-deng-chatgpt.hf.space/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(() => {
  'use strict';

  const STATE = {
    BEFORE: 'Idle',
    WHILE: 'Generating...',
    AFTER: 'Generation completed',
  };

  let currentState = STATE.BEFORE;
  let overlayDiv = null;
  let debounceTimer = null;

  // Track SSE connections open count
  let activeEventSourceCount = 0;

  // Track ongoing fetch/XHR count
  let activeRequestsCount = 0;

  // After timer to delay transition from While->After->Before
  let afterTimer = null;

  // Overlay creation
  function createOverlay() {
    if (overlayDiv) return;
    overlayDiv = document.createElement('div');
    Object.assign(overlayDiv.style, {
      position: 'fixed',
      bottom: '12px',
      left: '12px',
      backgroundColor: 'rgba(0,0,0,0.75)',
      color: '#FFA500',
      padding: '8px 14px',
      borderRadius: '7px',
      fontFamily: 'monospace',
      fontWeight: 'bold',
      fontSize: '14px',
      userSelect: 'none',
      pointerEvents: 'none',
      zIndex: 2147483647,
    });
    overlayDiv.textContent = 'Status: ' + currentState;
    document.body.appendChild(overlayDiv);
  }

  function updateOverlay(state) {
    if (!overlayDiv) createOverlay();
    if (state === currentState) return;
    currentState = state;

    switch (state) {
      case STATE.BEFORE:
        overlayDiv.style.color = '#FFA500';
        overlayDiv.textContent = 'Status: Idle';
        break;
      case STATE.WHILE:
        overlayDiv.style.color = '#00FF00';
        overlayDiv.textContent = 'Status: Generating...';
        break;
      case STATE.AFTER:
        overlayDiv.style.color = '#FF4500';
        overlayDiv.textContent = 'Status: Generation completed';
        break;
    }
  }

  // Debounced state updater
  function scheduleUpdate(state) {
    if (debounceTimer) clearTimeout(debounceTimer);
    debounceTimer = setTimeout(() => updateOverlay(state), 50);
  }

  // Called on fetch/XHR start
  function onRequestStart() {
    if (afterTimer) {
      clearTimeout(afterTimer);
      afterTimer = null;
    }
    activeRequestsCount++;
    scheduleUpdate(STATE.WHILE);
  }

  // Called on fetch/XHR end
  function onRequestEnd() {
    if (activeRequestsCount > 0) activeRequestsCount--;
    // If no active requests but SSE open active, stay "while"
    if (activeRequestsCount === 0) {
      if (activeEventSourceCount === 0) {
        // No SSE open, no requests, show after then before
        scheduleUpdate(STATE.AFTER);
        afterTimer = setTimeout(() => scheduleUpdate(STATE.BEFORE), 2000);
      } else {
        // SSE stream still open, keep "while"
        scheduleUpdate(STATE.WHILE);
      }
    }
  }

  // Patch fetch
  const originalFetch = window.fetch;
  window.fetch = function(...args) {
    onRequestStart();
    return originalFetch.apply(this, args).finally(() => {
      onRequestEnd();
    });
  };

  // Patch XMLHttpRequest
  const originalXHR = window.XMLHttpRequest;
  function newXHR() {
    const xhr = new originalXHR();

    xhr.addEventListener('loadstart', onRequestStart);
    xhr.addEventListener('loadend', onRequestEnd);
    xhr.addEventListener('error', onRequestEnd);
    xhr.addEventListener('abort', onRequestEnd);

    return xhr;
  }
  window.XMLHttpRequest = newXHR;

  // Patch EventSource globally
  const OriginalEventSource = window.EventSource;
  window.EventSource = function(url, config) {
    const es = new OriginalEventSource(url, config);

    // Increment active SSE count on open
    es.addEventListener('open', () => {
      activeEventSourceCount++;
      if (afterTimer) {
        clearTimeout(afterTimer);
        afterTimer = null;
      }
      scheduleUpdate(STATE.WHILE);
    });

    // On each message reset debounce timer (keep "while")
    es.addEventListener('message', () => {
      if (currentState !== STATE.WHILE) scheduleUpdate(STATE.WHILE);
    });

    es.addEventListener('error', () => {
      // Decrement active SSE count only if closed
      if (es.readyState === EventSource.CLOSED) {
        activeEventSourceCount = Math.max(0, activeEventSourceCount - 1);

        if (activeRequestsCount === 0 && activeEventSourceCount === 0) {
          scheduleUpdate(STATE.AFTER);
          afterTimer = setTimeout(() => scheduleUpdate(STATE.BEFORE), 2000);
        }
      }
    });

    return es;
  };

  if (document.body) {
    createOverlay();
  } else {
    window.addEventListener('DOMContentLoaded', createOverlay);
  }

  console.log('[HF ChatGPT Composite Monitor] Initialized');
})();
```