diff --git a/CTF/ctfs/wizer_ctf_6_hour_challenge_2024.md b/CTF/ctfs/wizer_ctf_6_hour_challenge_2024.md index 6969da0..06ae317 100644 --- a/CTF/ctfs/wizer_ctf_6_hour_challenge_2024.md +++ b/CTF/ctfs/wizer_ctf_6_hour_challenge_2024.md @@ -243,26 +243,22 @@ Here if we put GET parameter `mode=sw` then we can control the value of `const s explanation: -1. Parameter Retrieval: - +Parameter Retrieval: - `modeParam = searchParams.get('mode')`: 1. Stores the value of the query parameter named `mode` in the `modeParam` variable. - `colorParam = searchParams.get("color")`: 1. Similarly, retrieves the value of the `color` parameter and stores it in `colorParam`. -2. Element Updates: - +Element Updates: - `document.getElementById("mode").children[0].id = modeParam;`: 1. Finds the element with the ID "mode" and targets its first child element. 2. Sets the id attribute of the child element to the value of `modeParam`. - - `document.getElementById(modeParam).textContent = colorParam;`: 1. Uses the value of `modeParam` to look up an element by its ID 2. Sets the textContent of that element to the value of `colorParam`. -3. Service Worker Registration: - +Service Worker Registration: - `sw = document.getElementById('sw').innerText;`: 1. Retrieves the innerText (text content) of the element with the ID "sw". 2. Stores the retrieved content in the `sw` variable.