Oricon Text Copy Enabler

Enable text copying on Oricon website

目前為 2023-09-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Oricon Text Copy Enabler
// @name:ja      Oricon テキストコピー有効化
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Enable text copying on Oricon website
// @description:ja  Oriconのウェブサイトでテキストのコピーを有効にします
// @author       Tonikkl
// @match        https://www.oricon.co.jp/prof/*/lyrics/*/
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Override CSS properties to enable text selection
    var style = document.createElement('style');
    style.innerHTML = '.all-lyrics { user-select: text !important; -webkit-user-select: text !important; }';
    document.head.appendChild(style);

    // Remove the oncontextmenu, onmousedown, and onselectstart attributes
    var elements = document.querySelectorAll('.all-lyrics');
    for (var i = 0; i < elements.length; i++) {
        elements[i].removeAttribute('oncontextmenu');
        elements[i].removeAttribute('onmousedown');
        elements[i].removeAttribute('onselectstart');
    }
})();