YT觀看次數上移

YT觀看次數+上傳時間互換到頻道名後

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name     YT觀看次數上移
// @namespace https://greasyfork.org/zh-TW/users/4839-leadra
// @description YT觀看次數+上傳時間互換到頻道名後
// @version   1.0
// @author    SH3LL
// @license   MIT
// @match     *://*.youtube.com/watch*
// @grant     none
// @run-at    document-end
// @noframes

// ==/UserScript==
(function() {
    'use strict';

    const moveAndStyleElements = () => {
        //document.querySelector('#related')?.prepend(document.getElementById('bottom-row'));
        //document.querySelector('#related')?.prepend(document.getElementById('owner'));
        document.getElementById('actions')?.prepend(document.getElementById('info-container'));
        document.getElementById('info-container')?.setAttribute("style", "color:white; font-size: 16px;background-color: rgba(255, 255, 255, 0.1);");
        //document.getElementById('owner')?.setAttribute("style", "margin:0");

    };

    // OBSERVER FOR ELEMENTS TO MOVE
    const moveObserver = new MutationObserver(mutations => {
        if (document.getElementById('owner')) {
            moveObserver.disconnect();
            moveAndStyleElements();
        }
    });
    moveObserver.observe(document.body, { childList: true, subtree: true });

    // OBSERVER FOR ELEMENTS TO REMOVE
    const ui = new MutationObserver(mutations => {
        const elementsToRemoveIds = ['ytd-watch-info-text', 'expand', 'collapse', 'snippet'];
        elementsToRemoveIds.forEach(id => {
            const element = document.getElementById(id);
            if (element) {
                element.remove();
            }
        });

        let my_height = document.querySelector('.video-stream.html5-main-video');
        document.getElementById('description-inline-expander').style.maxHeight = (parseInt(my_height.style.height) - 70) + "px";
    });
    ui.observe(document.body, { childList: true, subtree: true });

})();