canvas.ts 660 B

12345678910111213141516
  1. /**
  2. * @license
  3. * Copyright Google Inc. All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. Zone.__load_patch('canvas', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
  9. const HTMLCanvasElement = global['HTMLCanvasElement'];
  10. if (typeof HTMLCanvasElement !== 'undefined' && HTMLCanvasElement.prototype &&
  11. HTMLCanvasElement.prototype.toBlob) {
  12. api.patchMacroTask(HTMLCanvasElement.prototype, 'toBlob', (self: any, args: any[]) => {
  13. return {name: 'HTMLCanvasElement.toBlob', target: self, cbIdx: 0, args: args};
  14. });
  15. }
  16. });