Created
January 9, 2018 22:49
-
-
Save SimonJThompson/fdd7d97c1388dbddf1c3419ecf4d7c13 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<script type="text/javascript" src="https://unpkg.com/[email protected]/promise.min.js"></script> | |
<script type="text/javascript" src="https://unpkg.com/[email protected]/fetch.js"></script> | |
<script type="text/javascript"> | |
(function() { | |
// Add your settings. | |
var dcWhitelist = ['YOUR_ORIGIN'] | |
, dcKey = encodeURIComponent('YOUR_KEY'); | |
// Check against the whitelist. | |
var dcOrigin = document.location.protocol + '//' + document.location.host; | |
if(dcWhitelist.indexOf( dcOrigin ) == -1) { | |
fetch('https://service.domaincanary.co/hit/?key=' + dcKey + '&origin=' + encodeURIComponent(dcOrigin)).then(function(resp) { | |
return resp.json(); | |
}).then(function(resp){}); | |
} | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment