@FinnReichertz/

Canvas.toDataURL blocker

HTML, CSS, JS

No description

fork
loading
Files
  • index.html
  • script.js
  • style.css

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6383135374325732","path":"index.html","file":{"path":"index.html","content":{"asEncoding":{"base64":"PCFET0NUWVBFIGh0bWw+CjxodG1sPgogIDxoZWFkPgo8c2NyaXB0PgogIGZ1bmN0aW9uIG1ha2VpZChsZW5ndGgpIHsKICAgIHZhciByZXN1bHQgICAgICAgICAgID0gJyc7CiAgICB2YXIgY2hhcmFjdGVycyAgICAgICA9ICdBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSc7CiAgICB2YXIgY2hhcmFjdGVyc0xlbmd0aCA9IGNoYXJhY3RlcnMubGVuZ3RoOwogICAgZm9yICggdmFyIGkgPSAwOyBpIDwgbGVuZ3RoOyBpKysgKSB7CiAgICAgIHJlc3VsdCArPSBjaGFyYWN0ZXJzLmNoYXJBdChNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiBjaGFyYWN0ZXJzTGVuZ3RoKSk7CiAgICB9CiAgIHJldHVybiByZXN1bHQ7CiAgfQoKICAoZnVuY3Rpb24oKSB7CiAgICBIVE1MQ2FudmFzRWxlbWVudC5wcm90b3R5cGUudG9EYXRhVVJMID0gZnVuY3Rpb24oKSB7CiAgICAgICAgcmV0dXJuICJkYXRhOmltYWdlLyIrKGFyZ3VtZW50c1swXSB8fCAicG5nIikrIjtiYXNlNjQsIittYWtlaWQoMTU3Mik7CiAgICB9OwogIH0oKSk7Cjwvc2NyaXB0PgoKICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04Ij4KICAgIDxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgiPgogICAgPHRpdGxlPnJlcGwuaXQ8L3RpdGxlPgogICAgPGxpbmsgaHJlZj0ic3R5bGUuY3NzIiByZWw9InN0eWxlc2hlZXQiIHR5cGU9InRleHQvY3NzIiAvPgoKICA8L2hlYWQ+CiAgPGJvZHk+CiAgICA8Y2FudmFzIGlkPSJjYW52YXMiPjwvY2FudmFzPgogICAgPHNjcmlwdCBzcmM9InNjcmlwdC5qcyI+PC9zY3JpcHQ+CiAgPC9ib2R5Pgo8L2h0bWw+"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE html>
<html>
  <head>
<script>
  function makeid(length) {
    var result           = '';
    var characters       = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    var charactersLength = characters.length;
    for ( var i = 0; i < length; i++ ) {
      result += characters.charAt(Math.floor(Math.random() * charactersLength));
    }
   return result;
  }

  (function() {
    HTMLCanvasElement.prototype.toDataURL = function() {
        return "data:image/"+(arguments[0] || "png")+";base64,"+makeid(1572);
    };
  }());
</script>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>repl.it</title>
    <link href="style.css" rel="stylesheet" type="text/css" />

  </head>
  <body>
    <canvas id="canvas"></canvas>
    <script src="script.js"></script>
  </body>
</html>
result
console