Skip to content

Instantly share code, notes, and snippets.

@SimonJThompson
Created January 9, 2018 22:49
Show Gist options
  • Save SimonJThompson/fdd7d97c1388dbddf1c3419ecf4d7c13 to your computer and use it in GitHub Desktop.
Save SimonJThompson/fdd7d97c1388dbddf1c3419ecf4d7c13 to your computer and use it in GitHub Desktop.
<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