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

Function reset

popup/index.js:1049–1079  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1047}
1048
1049async function reset() {
1050 const { checkPass } = await import("../scripts/auto_lockWebsite.js");
1051 if (
1052 !(await checkPass(
1053 t({
1054 vi: " chức năng Tự động khoá trang web",
1055 en: " feature Auto lock websites",
1056 })
1057 ))
1058 )
1059 return;
1060 Swal.fire({
1061 icon: "warning",
1062 title: t({ en: "Reset", vi: "Đặt lại" }),
1063 text: t({
1064 en: "All data will be deleted. Are you sure?",
1065 vi: "Tất cả dữ liệu sẽ bị xoá. Bạn có chắc không?",
1066 }),
1067 showCancelButton: true,
1068 confirmButtonText: t({ en: "Delete all", vi: "Xoá hết" }),
1069 confirmButtonColor: "#d33",
1070 cancelButtonText: t({ en: "Cancel", vi: "Huỷ" }),
1071 }).then((result) => {
1072 if (result.isConfirmed) {
1073 trackEvent("RESET");
1074 localStorage.clear();
1075 chrome.storage.local.clear();
1076 chrome.runtime.reload();
1077 }
1078 });
1079}
1080
1081function initSearch() {
1082 searchInput.addEventListener("input", (event) => {

Callers

nothing calls this directly

Calls 3

tFunction · 0.90
trackEventFunction · 0.90
checkPassFunction · 0.85

Tested by

no test coverage detected