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

Function initPassword

scripts/auto_lockWebsite.js:152–179  ·  view source on GitHub ↗
(createNew = false)

Source from the content-addressed store, hash-verified

150};
151
152export async function initPassword(createNew = false) {
153 const { t } = await import("../popup/helpers/lang.js");
154
155 if (!createNew) {
156 let pass = await locker.password.get();
157 if (pass) return true;
158 }
159
160 const { value: newPass } = await Swal.fire({
161 title: t({ vi: "Tạo mật khẩu mới", en: "Create new password" }),
162 icon: "info",
163 input: "password",
164 html: t({
165 vi: `Mật khẩu này dùng để mở khoá trang quản lý<br/>
166 và mở khoá các trang web<br/>
167 <p style="color:red">Hãy nhớ kỹ mật khẩu này</p>`,
168 en: `Used to open manager<br/>
169 and unlock websites<br/>
170 <p style="color:red">Please remember this password</p>`,
171 }),
172 showCancelButton: true,
173 });
174 if (newPass) {
175 await locker.password.set(newPass);
176 return true;
177 }
178 return false;
179}
180
181export async function checkPass(reason) {
182 const { t } = await import("../popup/helpers/lang.js");

Callers 2

initChangePassFunction · 0.90

Calls 2

getMethod · 0.80
tFunction · 0.50

Tested by

no test coverage detected