Skip to main content

JS Injector

JS Injector

image.png

Auto-Whitelist Cookies
  •  on index.html
  • 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));
  }
})();