Highlight GPT-4.1 Mini Responses

Highlights GPT-4.1 Mini responses with a semi-transparent red background

  1. // ==UserScript==
  2. // @name Highlight GPT-4.1 Mini Responses
  3. // @description Highlights GPT-4.1 Mini responses with a semi-transparent red background
  4. // @match https://chat.openai.com/*
  5. // @match https://chat.com/*
  6. // @match https://chatgpt.com/*
  7. // @grant none
  8. // @version 0.0.1.20250521112547
  9. // @namespace https://greasyfork.org/users/1435046
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. function highlightMiniResponses() {
  16. document.querySelectorAll('article').forEach(container => {
  17. const modelSlug = container.querySelector('[data-message-model-slug]');
  18. if (modelSlug?.getAttribute('data-message-model-slug') === 'gpt-4-1-mini') {
  19. Object.assign(container.style, {
  20. backgroundColor: "rgba(255, 0, 0, 0.2)", // Semi-transparent red background
  21. borderRadius: "8px"
  22. });
  23. } else {
  24. container.style.backgroundColor = "transparent";
  25. }
  26. });
  27. }
  28.  
  29. highlightMiniResponses();
  30.  
  31. const observer = new MutationObserver(highlightMiniResponses);
  32. observer.observe(document.body, { childList: true, subtree: true });
  33. })();