A script that automatically loads the "Videos" tab on a YouTube channel page as the default tab, after the webpage has loaded.
目前為
// ==UserScript==
// @name YouTube Videos Tab Auto-Loader
// @description A script that automatically loads the "Videos" tab on a YouTube channel page as the default tab, after the webpage has loaded.
// @version 1.0
// @author Midnight
// @match https://www.youtube.com/*/channel/*
// @run-at document-ready
// @grant none
// @license MIT
// @namespace https://greasyfork.org/users/1082643
// ==/UserScript==
(function() {
"use strict";
// Get the current document
const doc = document;
// Get the channel id from the URL
const channelId = doc.location.pathname.split("/")[3];
// Get the "Videos" tab
const videosTab = doc.getElementById("videos-tab");
// Set the "Videos" tab as the default tab
videosTab.setAttribute("selected", true);
})();