# JS Injector

<table border="1" id="bkmrk-js-injector" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><tbody><tr><td>JS Injector</td><td>[![image.png](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2026-03/scaled-1680-/0zyimage.png)](https://bookstack.notflix.pknw1.co.uk/uploads/images/gallery/2026-03/0zyimage.png)

</td></tr></tbody></table>

<details id="bkmrk-auto-whitelist-cooki"><summary>Auto-Whitelist Cookies</summary>

- [x]  on index.html
- [x] checks for `notflixuid` cookie
- [ ] if cookie DOES NOT exist
- [ ] loads URL `/resume/gen/<username> `
- [ ] URL is mapped to custom python api.notflix.pknw1.co.uk via nginx proxy manager
- [ ] reads the payload
- [ ] creates 1 year JWT
- [ ] returns JWT to store as cookie

```

    
(function () {
  function getCookie(name) {
    return document.cookie
      .split('; ')
      .find(row => row.startsWith(name + '='))
      ?.split('=')[1];
  }

  function setCookie(name, value, seconds) {
    document.cookie = `${name}=${encodeURIComponent(value)}; path=/; max-age=${seconds}; secure; samesite=lax`;
  }

  async function getSession(username) {
    const res = await fetch('/resume/gen/'+username);
    const data = await res.text(); // or res.text() if not JSON
    return data;
  }


  const existing = getCookie('notflixuid');

  if (!existing) {
    setTimeout(() => {
       const userButton = document.querySelector(".headerUserButton");
       const uid = userButton?.title?.toLowerCase();
       if (uid) {
        getSession(uid).then(sess => {
          setCookie('notflixuid', sess, 34560000); // 7 days
          console.log('Cookie set:', sess);
        });
      }

    }, 5000);
  } else {
    console.log('Cookie exists:', decodeURIComponent(existing));
  }
})();

```

</details>