Skip to content

Commit

Permalink
Update wizer_ctf_6_hour_challenge_2024.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Aftab700 authored Feb 7, 2024
1 parent 596a259 commit 3e3fcc0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions CTF/ctfs/wizer_ctf_6_hour_challenge_2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3e3fcc0

Please sign in to comment.