PageSourceSearch

https://www.toli.co.jp/common/js/login_check.js

js toli.co.jp collected 2026-09-24 20:47:25 UTC 755 bytes, 34 lines download raw bytes

1const toggleLogin = () => {
2	fetch("/member/home/logged_in")
3		.then(async (res) => {
4			const { logged_in } = await res.json();
5			const methodMap = logged_in
6				? {
7						logout: "remove",
8						login: "add",
9				  }
10				: {
11						logout: "add",
12						login: "remove",
13				  };
14			Object.entries(methodMap).forEach(([className, method]) => {
15				document
16					.querySelector(`.badge__link.${className}`)
17					.classList[method]("off");
18				document
19					.querySelector(`.p-headerSP__inquiryItem:has(.${className})`)
20					.classList[method]("off");
21			});
22		})
23		.catch((err) => {
24			console.log(err);
25		});
26};
27
28document.addEventListener("visibilitychange", () => {
29	if (document.visibilityState === "visible") {
30		toggleLogin();
31	}
32});
33
34toggleLogin();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.