Pulsante di conversione URL YouTube Shorts

Converti l'URL YouTube Shorts in URL video YouTube normale.

< Valutazione su Pulsante di conversione URL YouTube Shorts

Domanda/commento

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;
            }
        }
    });

最後的

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

改成

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

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

            convertButton.addEventListener('click', convertURL);
            convertButton.addEventListener('auxclick', function(event) {
                convertURL(event);
            });

改成

            convertButton.addEventListener('click', convertURL);
            convertButton.addEventListener('auxclick', convertURL);
const lang = navigator.language;

改成

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

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

改成

            if (data.match.startsWith(lang)) {
鮪魚大師Autore
§
Pubblicato: 26/02/2025

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

Pubblica risposta

Accedi per pubblicare una risposta.