Tab Name Changer

Lets you change the tab title for the current page

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Tab Name Changer
// @version      0.0.2
// @description  Lets you change the tab title for the current page
// @match        *://*/*
// @grant        GM_registerMenuCommand
// @namespace   random-uuid:c58b8350-b784-4996-bc18-9927cebe4862
// @license none
// ==/UserScript==

(function() {
  'use strict';

  // Function to change the tab title and save it to local storage
  function changeTabTitle(newTitle) {
    document.title = newTitle;
    localStorage.setItem(window.location.href, newTitle);
  }

  // Function to clear the tab title from local storage
  function clearTabTitle() {
    localStorage.removeItem(window.location.href);
    document.title = '';
  }

// Function to load the tab title from local storage with delay
  function loadTabTitle() {
    setTimeout(function() {
      const savedTitle = localStorage.getItem(window.location.href);
      if (savedTitle) {
        document.title = savedTitle;
      }
    }, 1000); // 2000 milliseconds delay
  }

  // Create menu button in Tampermonkey menu for changing the tab title
  GM_registerMenuCommand("Tab Name Changer", function() {
    const newTitle = prompt("Enter the new tab title:");
    if (newTitle) {
      changeTabTitle(newTitle);
    }
  });

  // Create menu button in Tampermonkey menu for clearing the tab title
  GM_registerMenuCommand("Clear Tab Title", function() {
    clearTabTitle();
  });

  // Load the tab title when the page loads
  loadTabTitle();
})();