Always Show Copy and Edit Buttons

Make copy and edit buttons always visible on Lambda Chat

  1. // ==UserScript==
  2. // @name Always Show Copy and Edit Buttons
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @license MIT
  6. // @description Make copy and edit buttons always visible on Lambda Chat
  7. // @match https://lambda.chat/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. // Function to modify buttons visibility
  15. function makeButtonsVisible() {
  16. // Select all copy button containers
  17. const copyButtons = document.querySelectorAll('.invisible.md\\:group-hover\\:visible');
  18. // Select all edit/branch buttons with the specific classes
  19. const editButtons = document.querySelectorAll('.group-hover\\:block.md\\:hidden');
  20.  
  21. // Make copy buttons visible
  22. copyButtons.forEach(button => {
  23. button.classList.remove('invisible');
  24. button.classList.add('visible');
  25. button.style.opacity = '1';
  26. });
  27.  
  28. // Make edit buttons visible
  29. editButtons.forEach(button => {
  30. button.classList.remove('md:hidden');
  31. button.style.display = 'block';
  32. // Remove group-hover:block since we want it always visible
  33. button.classList.remove('group-hover:block');
  34. });
  35. }
  36.  
  37. // Run initially
  38. makeButtonsVisible();
  39.  
  40. // Create observer to handle dynamically added buttons
  41. const observer = new MutationObserver(() => {
  42. makeButtonsVisible();
  43. });
  44.  
  45. // Start observing the document for added nodes
  46. observer.observe(document.body, {
  47. childList: true,
  48. subtree: true
  49. });
  50. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址