html2canvas-pro 1.5.9 → 1.5.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * html2canvas-pro 1.5.9 <https://yorickshan.github.io/html2canvas-pro/>
2
+ * html2canvas-pro 1.5.11 <https://yorickshan.github.io/html2canvas-pro/>
3
3
  * Copyright (c) 2024-present yorickshan and html2canvas-pro contributors
4
4
  * Released under MIT License
5
5
  */
@@ -3737,7 +3737,7 @@
3737
3737
  case 'gurmukhi':
3738
3738
  return 22 /* LIST_STYLE_TYPE.GURMUKHI */;
3739
3739
  case 'hebrew':
3740
- return 22 /* LIST_STYLE_TYPE.HEBREW */;
3740
+ return 52 /* LIST_STYLE_TYPE.HEBREW */;
3741
3741
  case 'hiragana':
3742
3742
  return 23 /* LIST_STYLE_TYPE.HIRAGANA */;
3743
3743
  case 'hiragana-iroha':
@@ -6015,7 +6015,7 @@
6015
6015
  return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);
6016
6016
  case 22 /* LIST_STYLE_TYPE.GURMUKHI */:
6017
6017
  return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);
6018
- case 22 /* LIST_STYLE_TYPE.HEBREW */:
6018
+ case 52 /* LIST_STYLE_TYPE.HEBREW */:
6019
6019
  return createAdditiveCounter(value, 1, 10999, HEBREW, 3 /* LIST_STYLE_TYPE.DECIMAL */, defaultSuffix);
6020
6020
  case 23 /* LIST_STYLE_TYPE.HIRAGANA */:
6021
6021
  return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');
@@ -6592,12 +6592,21 @@
6592
6592
  };
6593
6593
  Cache.prototype.loadImage = function (key) {
6594
6594
  return __awaiter(this, void 0, void 0, function () {
6595
- var isSameOrigin, useCORS, useProxy, src;
6595
+ var isSameOrigin, _a, useCORS, useProxy, src;
6596
6596
  var _this = this;
6597
- return __generator(this, function (_a) {
6598
- switch (_a.label) {
6597
+ return __generator(this, function (_b) {
6598
+ switch (_b.label) {
6599
6599
  case 0:
6600
- isSameOrigin = CacheStorage.isSameOrigin(key);
6600
+ if (!(typeof this._options.customIsSameOrigin === 'function')) return [3 /*break*/, 2];
6601
+ return [4 /*yield*/, this._options.customIsSameOrigin(key, CacheStorage.isSameOrigin)];
6602
+ case 1:
6603
+ _a = _b.sent();
6604
+ return [3 /*break*/, 3];
6605
+ case 2:
6606
+ _a = CacheStorage.isSameOrigin(key);
6607
+ _b.label = 3;
6608
+ case 3:
6609
+ isSameOrigin = _a;
6601
6610
  useCORS = !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;
6602
6611
  useProxy = !isInlineImage(key) &&
6603
6612
  !isSameOrigin &&
@@ -6614,12 +6623,12 @@
6614
6623
  return [2 /*return*/];
6615
6624
  }
6616
6625
  src = key;
6617
- if (!useProxy) return [3 /*break*/, 2];
6626
+ if (!useProxy) return [3 /*break*/, 5];
6618
6627
  return [4 /*yield*/, this.proxy(src)];
6619
- case 1:
6620
- src = _a.sent();
6621
- _a.label = 2;
6622
- case 2:
6628
+ case 4:
6629
+ src = _b.sent();
6630
+ _b.label = 5;
6631
+ case 5:
6623
6632
  this.context.logger.debug("Added image ".concat(key.substring(0, 256)));
6624
6633
  return [4 /*yield*/, new Promise(function (resolve, reject) {
6625
6634
  var img = new Image();
@@ -6638,7 +6647,7 @@
6638
6647
  setTimeout(function () { return reject("Timed out (".concat(_this._options.imageTimeout, "ms) loading image")); }, _this._options.imageTimeout);
6639
6648
  }
6640
6649
  })];
6641
- case 3: return [2 /*return*/, _a.sent()];
6650
+ case 6: return [2 /*return*/, _b.sent()];
6642
6651
  }
6643
6652
  });
6644
6653
  });
@@ -8681,7 +8690,8 @@
8681
8690
  allowTaint: (_b = opts.allowTaint) !== null && _b !== void 0 ? _b : false,
8682
8691
  imageTimeout: (_c = opts.imageTimeout) !== null && _c !== void 0 ? _c : 15000,
8683
8692
  proxy: opts.proxy,
8684
- useCORS: (_d = opts.useCORS) !== null && _d !== void 0 ? _d : false
8693
+ useCORS: (_d = opts.useCORS) !== null && _d !== void 0 ? _d : false,
8694
+ customIsSameOrigin: opts.customIsSameOrigin
8685
8695
  };
8686
8696
  contextOptions = __assign({ logging: (_e = opts.logging) !== null && _e !== void 0 ? _e : true, cache: opts.cache }, resourceOptions);
8687
8697
  windowOptions = {