Last active
January 4, 2016 04:39
-
-
Save dun4n/8570121 to your computer and use it in GitHub Desktop.
Use CSP to detect if a user is logged in to Github.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta content="img-src https://github.com/login;" http-equiv="Content-Security-Policy"> | |
<script type="text/javascript"> | |
var islogged = true | |
window.onload = function() { console.log("Logged in to Github : " + islogged) } | |
</script> | |
<img src="https://github.com/login" onerror="islogged = false" /> | |
</head> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment