Skip to content

Instantly share code, notes, and snippets.

@josemmo
Created March 28, 2018 08:17
Show Gist options
  • Save josemmo/4fce33f75a4cd449205ff7e979b03b21 to your computer and use it in GitHub Desktop.
Save josemmo/4fce33f75a4cd449205ff7e979b03b21 to your computer and use it in GitHub Desktop.
// Canvas fingerprint
var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');
var canvasTxt = 'Texto de prueba';
ctx.textBaseline = 'top';
ctx.font = '16px Arial';
ctx.textBaseline = 'alphabetic';
ctx.fillStyle = '#f60';
ctx.fillRect(125, 1, 62, 20);
ctx.fillStyle = '#069';
ctx.fillText(canvasTxt, 2, 15);
ctx.fillStyle = 'rgba(102, 204, 0, 0.7)';
ctx.fillText(canvasTxt, 4, 17);
fp_sources.hardware.canvas = canvas.toDataURL();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment