()
| 1047 | } |
| 1048 | |
| 1049 | async 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 | |
| 1081 | function initSearch() { |
| 1082 | searchInput.addEventListener("input", (event) => { |
nothing calls this directly
no test coverage detected