zone-patch-canvas.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  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. (function (global, factory) {
  9. typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
  10. typeof define === 'function' && define.amd ? define(factory) :
  11. (factory());
  12. }(this, (function () { 'use strict';
  13. /**
  14. * @license
  15. * Copyright Google Inc. All Rights Reserved.
  16. *
  17. * Use of this source code is governed by an MIT-style license that can be
  18. * found in the LICENSE file at https://angular.io/license
  19. */
  20. Zone.__load_patch('canvas', function (global, Zone, api) {
  21. var HTMLCanvasElement = global['HTMLCanvasElement'];
  22. if (typeof HTMLCanvasElement !== 'undefined' && HTMLCanvasElement.prototype &&
  23. HTMLCanvasElement.prototype.toBlob) {
  24. api.patchMacroTask(HTMLCanvasElement.prototype, 'toBlob', function (self, args) {
  25. return { name: 'HTMLCanvasElement.toBlob', target: self, cbIdx: 0, args: args };
  26. });
  27. }
  28. });
  29. })));