ChatGPT Remove In-Text Citations

Hide and remove In-Text Citations from all ChatGPT responses.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         ChatGPT Remove In-Text Citations
// @namespace    https://chatgpt.com/
// @version      1.0
// @description  Hide and remove In-Text Citations from all ChatGPT responses.
// @author       groundcat
// @match        https://chatgpt.com/*
// @icon         https://chatgpt.com/favicon.ico
// @grant        none
// @license MIT
// ==/UserScript==

(function () {
  'use strict';

  /* Quick removal via CSS — avoids layout flashes */
  const style = document.createElement('style');
  style.textContent = `
    /* Hide any element that contains BOTH classes */
    .text-token-text-secondary.inline-flex {
      display: none !important;
    }
  `;
  document.head.appendChild(style);

  /* Defensive clean‑up — catches elements injected after page load */
  function scrub(root = document) {
    root.querySelectorAll('.text-token-text-secondary.inline-flex').forEach((node) => node.remove());
  }

  // Initial pass for anything already on screen
  scrub();

  // Observe DOM mutations so we stay ahead of streaming messages or edits
  const observer = new MutationObserver((mutations) => {
    for (const m of mutations) {
      m.addedNodes.forEach((n) => {
        if (n.nodeType === 1) {
          // Only process element nodes
          scrub(n);
        }
      });
    }
  });

  observer.observe(document.body, { childList: true, subtree: true });
})();