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