MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / updateButtonChecker

Function updateButtonChecker

popup/index.js:528–546  ·  view source on GitHub ↗
(script, checkmarkContainer, val)

Source from the content-addressed store, hash-verified

526}
527
528async function updateButtonChecker(script, checkmarkContainer, val) {
529 let checkmark = checkmarkContainer.querySelector(".checkmark");
530 if (!checkmark) return;
531 let tooltip = "";
532 if (val ?? (await isActiveScript(script.id))) {
533 checkmark.classList.add("active");
534 tooltip = t({
535 vi: "Tắt tự chạy",
536 en: "Turn off Autorun",
537 });
538 } else {
539 checkmark.classList.remove("active");
540 tooltip = t({
541 vi: "Bật tự chạy",
542 en: "Turn on Autorun",
543 });
544 }
545 checkmarkContainer.setAttribute("data-tooltip", tooltip);
546}
547
548function showError(e) {
549 Swal.fire({

Callers 1

createScriptButtonFunction · 0.85

Calls 4

isActiveScriptFunction · 0.90
tFunction · 0.90
addMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected