Update Claude.ai Chat Page Title

Updates the page title on Claude.ai chat pages every 10 seconds

  1. // ==UserScript==
  2. // @name Update Claude.ai Chat Page Title
  3. // @namespace https://github.com/mefengl
  4. // @version 0.0.1
  5. // @description Updates the page title on Claude.ai chat pages every 10 seconds
  6. // @author mefengl
  7. // @match https://claude.ai/chat/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=claude.ai
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Function to update the page title
  17. const updateTitle = () => {
  18. // Query the text content of the specific element
  19. const elementText = document.querySelector("button>div>div.truncate").textContent;
  20.  
  21. // Update the title of the document
  22. document.title = elementText;
  23. };
  24.  
  25. setTimeout(updateTitle, 1000);
  26.  
  27. // Run updateTitle function every 10 seconds (10000 milliseconds)
  28. setInterval(updateTitle, 10000);
  29. })();