Uta-Net 恢復複製操作

解決無法複製歌詞的困擾

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Uta-Net 恢復複製操作
// @namespace    https://home.gamer.com.tw/homeindex.php?owner=xu3u04u48
// @version      2025-05-25
// @description  解決無法複製歌詞的困擾
// @author       xu3u04u48
// @match        https://www.uta-net.com/song/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=uta-net.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
  document.body.oncopy = null;
  document.body.oncut = null;
  document.body.oncontextmenu = null;
  document.body.onselectstart = null;
  document.body.onmousedown = null;
  document.body.onmouseup = null;
  document.body.onkeydown = null;
  document.body.onkeypress = null;
  document.body.onkeyup = null;

  var elem = document.querySelector('.moviesong');
  if (elem) {
    elem.style.userSelect = 'text';
    elem.style.webkitUserSelect = 'text';
    elem.style.msUserSelect = 'text';
    elem.style.pointerEvents = 'auto';
    elem.replaceWith(elem.cloneNode(true));
  }

  // 移除所有帶 user-select: none 的元素限制
  Array.from(document.querySelectorAll('*')).forEach(e=>{
    e.style.userSelect='text';
    e.style.webkitUserSelect='text';
    e.style.msUserSelect='text';
  });

})();