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
 
@@ -5529,10 +5529,40 @@ var net$1 = {}; //--------------------------------------------------------
5529
5529
  //--------------------------------------------------------
5530
5530
 
5531
5531
  {
5532
+ var AbortController = function AbortController() {
5533
+ var _this = this;
5534
+
5535
+ Object.defineProperty(this, 'signal', {
5536
+ get: function get() {
5537
+ if (!_this.__signalWrap) {
5538
+ _this.__signalWrap = {};
5539
+ }
5540
+
5541
+ return _this.__signalWrap;
5542
+ },
5543
+ enumerable: true,
5544
+ configurable: true
5545
+ });
5546
+ };
5547
+
5532
5548
  if (!Promise) {
5533
5549
  throw new Error('unsupported Promise');
5534
- } // https://github.com/github/fetch
5550
+ }
5551
+
5552
+ AbortController.prototype.abort = function () {
5553
+ if (this.__signalWrap && this.__signalWrap.__xhr) {
5554
+ try {
5555
+ this.__signalWrap.__xhr.abort();
5556
+ } catch (e) {
5557
+ console.log(e);
5558
+ }
5559
+
5560
+ this.__signalWrap.__xhr = null;
5561
+ }
5562
+ };
5535
5563
 
5564
+ Window$2._AbortController = AbortController;
5565
+ net$1.AbortController = AbortController; // https://github.com/github/fetch
5536
5566
 
5537
5567
  febsnet.normalizeName = function (name) {
5538
5568
  if (typeof name !== 'string') {
@@ -5914,7 +5944,7 @@ var net$1 = {}; //--------------------------------------------------------
5914
5944
  var status = xhr.status === 1223 ? 204 : xhr.status;
5915
5945
 
5916
5946
  if (status < 100 || status > 599) {
5917
- reject(new exception('Network request failed', 'NetworkFailed', __filename, __line, __column));
5947
+ reject(new exception('Network request failed', 'NetworkFailed', null, null, null));
5918
5948
  return;
5919
5949
  }
5920
5950
 
@@ -5930,21 +5960,25 @@ var net$1 = {}; //--------------------------------------------------------
5930
5960
  };
5931
5961
 
5932
5962
  xhr.ontimeout = function () {
5933
- reject(new exception('Network timeout', 'NetworkTimeout', __filename, __line, __column));
5963
+ reject(new exception('Network timeout', 'NetworkTimeout', null, null, null));
5934
5964
  };
5935
5965
 
5936
5966
  xhr.onerror = function () {
5937
- reject(new exception('Network request failed', 'NetworkFailed', __filename, __line, __column));
5967
+ reject(new exception('Network request failed', 'NetworkFailed', null, null, null));
5938
5968
  };
5939
5969
 
5940
5970
  if (init && init.progress) {
5941
5971
  xhr.onprogress = function (event) {
5942
5972
  if (event.lengthComputable) {
5943
- init.progress(event.position / event.totalSize);
5973
+ init.progress((event.position || event.loaded || 0) / (event.totalSize || event.total || 1));
5944
5974
  }
5945
5975
  };
5946
5976
  }
5947
5977
 
5978
+ if (init && init.signal) {
5979
+ init.signal.__xhr = xhr;
5980
+ }
5981
+
5948
5982
  xhr.open(request.method, request.url, true);
5949
5983
  var timeout = init ? init.timeout : null;
5950
5984
  xhr.timeout = timeout !== undefined && timeout !== null ? timeout : net_transfer.DefaultTimeout;
@@ -5961,13 +5995,17 @@ var net$1 = {}; //--------------------------------------------------------
5961
5995
 
5962
5996
  if (xhr.setRequestHeader) {
5963
5997
  request.headers.forEach(function (value, name) {
5964
- xhr.setRequestHeader(name, value);
5998
+ xhr.setRequestHeader(name, value.join(','));
5965
5999
  });
5966
6000
  } else if (request.headers && request.headers.map.length > 0) {
5967
6001
  console.log('fetch can\'t set headers');
5968
6002
  }
5969
6003
 
5970
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
6004
+ try {
6005
+ xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
6006
+ } catch (e) {
6007
+ reject(new exception('Network request failed', 'NetworkFailed', null, null, null));
6008
+ }
5971
6009
  });
5972
6010
  };
5973
6011
 
@@ -6049,6 +6087,7 @@ var net_jsonp = net$2;
6049
6087
 
6050
6088
  var net$3 = {
6051
6089
  ajax: net_ajax.ajax,
6090
+ AbortController: net_fetch.AbortController,
6052
6091
  fetch: net_fetch.fetch,
6053
6092
  jsonp: net_jsonp.jsonp
6054
6093
  };