febs-browser 1.2.10 → 1.2.12

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,6 +1,6 @@
1
1
  /*!
2
- * febs v1.2.10
3
- * Copyright (c) 2021 bpoint.lee@gmail.com All Rights Reserved.
2
+ * febs v1.2.12
3
+ * Copyright (c) 2026 bpoint.lee@gmail.com All Rights Reserved.
4
4
  * Released under the MIT License.
5
5
  */
6
6
 
@@ -5525,10 +5525,40 @@ var net$1 = {}; //--------------------------------------------------------
5525
5525
  //--------------------------------------------------------
5526
5526
 
5527
5527
  {
5528
+ var AbortController = function AbortController() {
5529
+ var _this = this;
5530
+
5531
+ Object.defineProperty(this, 'signal', {
5532
+ get: function get() {
5533
+ if (!_this.__signalWrap) {
5534
+ _this.__signalWrap = {};
5535
+ }
5536
+
5537
+ return _this.__signalWrap;
5538
+ },
5539
+ enumerable: true,
5540
+ configurable: true
5541
+ });
5542
+ };
5543
+
5528
5544
  if (!Promise) {
5529
5545
  throw new Error('unsupported Promise');
5530
- } // https://github.com/github/fetch
5546
+ }
5547
+
5548
+ AbortController.prototype.abort = function () {
5549
+ if (this.__signalWrap && this.__signalWrap.__xhr) {
5550
+ try {
5551
+ this.__signalWrap.__xhr.abort();
5552
+ } catch (e) {
5553
+ console.log(e);
5554
+ }
5555
+
5556
+ this.__signalWrap.__xhr = null;
5557
+ }
5558
+ };
5531
5559
 
5560
+ Window$2._AbortController = AbortController;
5561
+ net$1.AbortController = AbortController; // https://github.com/github/fetch
5532
5562
 
5533
5563
  febsnet.normalizeName = function (name) {
5534
5564
  if (typeof name !== 'string') {
@@ -5910,7 +5940,7 @@ var net$1 = {}; //--------------------------------------------------------
5910
5940
  var status = xhr.status === 1223 ? 204 : xhr.status;
5911
5941
 
5912
5942
  if (status < 100 || status > 599) {
5913
- reject(new exception('Network request failed', 'NetworkFailed', __filename, __line, __column));
5943
+ reject(new exception('Network request failed', 'NetworkFailed', null, null, null));
5914
5944
  return;
5915
5945
  }
5916
5946
 
@@ -5926,21 +5956,25 @@ var net$1 = {}; //--------------------------------------------------------
5926
5956
  };
5927
5957
 
5928
5958
  xhr.ontimeout = function () {
5929
- reject(new exception('Network timeout', 'NetworkTimeout', __filename, __line, __column));
5959
+ reject(new exception('Network timeout', 'NetworkTimeout', null, null, null));
5930
5960
  };
5931
5961
 
5932
5962
  xhr.onerror = function () {
5933
- reject(new exception('Network request failed', 'NetworkFailed', __filename, __line, __column));
5963
+ reject(new exception('Network request failed', 'NetworkFailed', null, null, null));
5934
5964
  };
5935
5965
 
5936
5966
  if (init && init.progress) {
5937
5967
  xhr.onprogress = function (event) {
5938
5968
  if (event.lengthComputable) {
5939
- init.progress(event.position / event.totalSize);
5969
+ init.progress((event.position || event.loaded || 0) / (event.totalSize || event.total || 1));
5940
5970
  }
5941
5971
  };
5942
5972
  }
5943
5973
 
5974
+ if (init && init.signal) {
5975
+ init.signal.__xhr = xhr;
5976
+ }
5977
+
5944
5978
  xhr.open(request.method, request.url, true);
5945
5979
  var timeout = init ? init.timeout : null;
5946
5980
  xhr.timeout = timeout !== undefined && timeout !== null ? timeout : net_transfer.DefaultTimeout;
@@ -5957,13 +5991,17 @@ var net$1 = {}; //--------------------------------------------------------
5957
5991
 
5958
5992
  if (xhr.setRequestHeader) {
5959
5993
  request.headers.forEach(function (value, name) {
5960
- xhr.setRequestHeader(name, value);
5994
+ xhr.setRequestHeader(name, value.join(','));
5961
5995
  });
5962
5996
  } else if (request.headers && request.headers.map.length > 0) {
5963
5997
  console.log('fetch can\'t set headers');
5964
5998
  }
5965
5999
 
5966
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
6000
+ try {
6001
+ xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
6002
+ } catch (e) {
6003
+ reject(new exception('Network request failed', 'NetworkFailed', null, null, null));
6004
+ }
5967
6005
  });
5968
6006
  };
5969
6007
 
@@ -6045,6 +6083,7 @@ var net_jsonp = net$2;
6045
6083
 
6046
6084
  var net$3 = {
6047
6085
  ajax: net_ajax.ajax,
6086
+ AbortController: net_fetch.AbortController,
6048
6087
  fetch: net_fetch.fetch,
6049
6088
  jsonp: net_jsonp.jsonp
6050
6089
  };