YouTube Shorts URL 转换按钮

将 YouTube Shorts 网址转换为常规的 YouTube 视频网址。

< 脚本YouTube Shorts URL 转换按钮的反馈

提问/评论

§
发表于:2025-02-24

Coding改善建議

    const observer = new MutationObserver(function(mutationsList) {
        for (const mutation of mutationsList) {
            if (mutation.type === 'childList') {
                checkAndCreateButton();
            }
        }
    });

改成

    const observer = new MutationObserver(function(mutationsList) {
        for (const mutation of mutationsList) {
            if (mutation.type === 'childList') {
                checkAndCreateButton();
                break;
            }
        }
    });
§
发表于:2025-02-24

最後的

observer.observe(document.documentElement, { childList: true, subtree: true });

改成

observer.observe(document.documentElement, { childList: true, subtree: true });
checkAndCreateButton();
§
发表于:2025-02-24

createButtons生成了兩個,為什麼remove的部份只清除ConvertButton??

§
发表于:2025-02-24
            convertButton.addEventListener('click', convertURL);
            convertButton.addEventListener('auxclick', function(event) {
                convertURL(event);
            });

改成

            convertButton.addEventListener('click', convertURL);
            convertButton.addEventListener('auxclick', convertURL);
§
发表于:2025-02-24
const lang = navigator.language;

改成

const lang = document.documentElement.lang || navigator.language;

            if (data.match.includes(lang)) {

改成

            if (data.match.startsWith(lang)) {
鮪魚大師作者
§
发表于:2025-02-26

感謝大佬指點 有人留言都沒有email通知

发表回复

登录(不可用)以发表回复。

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址