Кнопка преобразования URL YouTube Shorts

Преобразование URL YouTube Shorts в обычный URL видео YouTube.

< Обсуждения: Кнопка преобразования URL YouTube Shorts

Вопрос или комментарий

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)) {

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

Ответить

Войдите, чтобы ответить.