Fk chai limits

Script này sẽ không được không được cài đặt trực tiếp. Nó là một thư viện cho các script khác để bao gồm các chỉ thị meta // @require https://update.greatest.deepsurf.us/scripts/571951/1787236/Fk%20chai%20limits.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Fk chai limits
// @namespace   Violentmonkey Scripts
// @match       *://*.chai-research.com/chat/*
// @icon        https://web.chai-research.com/favicon.ico
// @grant       none
// @version     1.2
// @author      SkipUsernameRE
// ==/UserScript==

(function() {
  'use strict';

  setInterval(() => {
    localStorage.setItem("conversation_turns", "0");
  }, 1000);

  const observer = new MutationObserver(() => {
    const divs = document.querySelectorAll(
      'div.self-start.mr-10.flex.flex-row.gap-4.my-2.sm\\:my-4.items-start.relative'
    );

    divs.forEach(div => {
      Array.from(div.querySelectorAll('button'))
        .filter(btn => btn.textContent.trim() === "Click to see the message...")
        .forEach(btn => btn.remove()); // <--- removes the "Click to see the message..." button/text from the message container

      div.querySelectorAll('div.blur-sm')
        .forEach(childDiv => childDiv.classList.remove('blur-sm')); // <--- removes the blur from the messsage container
    });

    const shareButton = document.querySelector('button[aria-label="CHAI WEB | Share Button"]'); // <--- removes share button (some find it distracting, remove the line below to disable)
    if (shareButton) shareButton.remove();

    const flexContainers = document.querySelectorAll('div.flex.flex-col.h-\\[90svh\\].lg\\:h-\\[100vh\\]');
    flexContainers.forEach(container => {
      const targetChild = container.querySelector('div.relative.px-4.md\\:py-2');
      if (targetChild) targetChild.remove();
    });

    const elems = document.querySelectorAll('[class*="bg-black/50"]');
    elems.forEach(el => el.remove()); // <--- removes the annoying "Chat with {x} on CHAI App" popup
  });

  observer.observe(document.body, { childList: true, subtree: true }); // <--- observes the DOM for added or removed elements
})();