zone-patch-canvas.js 657 B

1234567891011121314151617181920
  1. 'use strict';
  2. /**
  3. * @license Angular v<unknown>
  4. * (c) 2010-2025 Google LLC. https://angular.io/
  5. * License: MIT
  6. */
  7. function patchCanvas(Zone) {
  8. Zone.__load_patch('canvas', (global, Zone, api) => {
  9. const HTMLCanvasElement = global['HTMLCanvasElement'];
  10. if (typeof HTMLCanvasElement !== 'undefined' &&
  11. HTMLCanvasElement.prototype &&
  12. HTMLCanvasElement.prototype.toBlob) {
  13. api.patchMacroTask(HTMLCanvasElement.prototype, 'toBlob', (self, args) => {
  14. return { name: 'HTMLCanvasElement.toBlob', target: self, cbIdx: 0, args: args };
  15. });
  16. }
  17. });
  18. }
  19. patchCanvas(Zone);