Greasy Fork is available in English.

TikTok Magic (dynamischer Download)

Laden Sie Videos ohne Logo/Wasserzeichen mit nur einem Klick direkt von TikTok herunter. Weitere Funktionen bald verfügbar.

< Rückmeldungen auf TikTok Magic (dynamischer Download)

Rezension: Gut - Skript funktioniert

§
Veröffentlicht: 21.07.2024
Bearbeitet: 21.07.2024

Cơ bản trang chủ họ làm 1 kiểu, trang video chi tiết 1 kiểu cho nên tôi muốn hỏi làm thế nào để tôi thêm nút vào css-q0a591-DivActionItemContainer ees02z00 và css-1elr43g-DivActionBarWrapper eqrezik8. tôi có thử


if (document.querySelector(".css-1elr43g-DivActionBarWrapper.eqrezik8")) {
document.head.appendChild(styleElement1);
const targetElement = document.querySelector(".css-1elr43g-DivActionBarWrapper.eqrezik8");
targetElement.insertAdjacentElement('afterend', linkElement);
} else if (document.querySelector(".css-q0a591-DivActionItemContainer.ees02z00")) {
document.head.appendChild(styleElement2);
const targetElement = document.querySelector(".css-q0a591-DivActionItemContainer.ees02z00");
targetElement.insertAdjacentElement('afterend', linkElement);
} else if (document.querySelector(".css-1s9jpf8-ButtonBasicButtonContainer-StyledVideoSwitch.e11s2kul11")) {
document.head.appendChild(styleElement1);
const targetElement = document.querySelector('.css-1s9jpf8-ButtonBasicButtonContainer-StyledVideoSwitch.e11s2kul11');
targetElement.insertAdjacentElement('afterend', linkElement);
} else if (document.querySelector(".css-ty9aj4-DivVideoContainer.eqrezik7")) {
document.head.appendChild(styleElement2);
const targetElement = document.querySelector('.css-ty9aj4-DivVideoContainer.eqrezik7');
targetElement.insertAdjacentElement('afterend', linkElement);
} else {
document.head.appendChild(styleElement1);
document.querySelector("#app-header").appendChild(linkElement);
}

nhưng kết quả khá tệ

§
Veröffentlicht: 21.07.2024

sau khi chỉnh sửa một chút

if(document.querySelector(".css-1elr43g-DivActionBarWrapper.eqrezik8")){
document.head.appendChild(styleElement1);
const targetElement = document.querySelector(".css-1elr43g-DivActionBarWrapper.eqrezik8");
targetElement.insertAdjacentElement('afterend', linkElement);
}else if(document.querySelector(".css-q0a591-DivActionItemContainer.ees02z00")){
document.head.appendChild(styleElement2);
const targetElement = document.querySelector(".css-q0a591-DivActionItemContainer.ees02z00");
targetElement.insertAdjacentElement('afterend', linkElement);
}else if(document.querySelector(".css-1s9jpf8-ButtonBasicButtonContainer-StyledVideoSwitch.e11s2kul11")){
// Selecionar o elemento com a classe específica
document.head.appendChild(styleElement1);
const targetElement = document.querySelector('.css-1s9jpf8-ButtonBasicButtonContainer-StyledVideoSwitch.e11s2kul11');
targetElement.insertAdjacentElement('afterend', linkElement);
}else if(document.querySelector(".css-ty9aj4-DivVideoContainer.eqrezik7")){
document.head.appendChild(styleElement2);
const targetElement = document.querySelector('.css-ty9aj4-DivVideoContainer.eqrezik7');
targetElement.insertAdjacentElement('afterend', linkElement);
}else{
document.head.appendChild(styleElement1);
document.querySelector("#app-header").appendChild(linkElement);
}

thì lại không thấy nút tải xuống ở vị trí nguyên bản

Antwort schreiben

Anmelden um eine Antwort zu senden.