@whitesev/utils 1.4.3 → 1.4.5
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.
- package/dist/index.amd.js +7 -5
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +7 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +7 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +7 -5
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +7 -5
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +7 -5
- package/dist/index.umd.js.map +1 -1
- package/dist/src/Utils.d.ts +2 -87
- package/dist/src/VueObject.d.ts +107 -0
- package/package.json +1 -1
- package/src/Utils.ts +3 -99
- package/src/VueObject.ts +119 -0
- package/src/ajaxHooker/ajaxHooker.js +6 -4
package/dist/index.system.js
CHANGED
|
@@ -463,13 +463,14 @@ System.register('Utils', [], (function (exports) {
|
|
|
463
463
|
/// <reference path="./index.d.ts" />
|
|
464
464
|
// @name ajaxHooker
|
|
465
465
|
// @author cxxjackie
|
|
466
|
-
// @version 1.4.
|
|
467
|
-
// @updateLog
|
|
466
|
+
// @version 1.4.3
|
|
467
|
+
// @updateLog 修复特殊情况下有部分请求头丢失的问题。
|
|
468
|
+
// @updateLog xhr事件增加currentTarget劫持。
|
|
468
469
|
// @supportURL https://bbs.tampermonkey.net.cn/thread-3284-1-1.html
|
|
469
470
|
|
|
470
471
|
const AjaxHooker = function () {
|
|
471
472
|
return function() {
|
|
472
|
-
const version = '1.4.
|
|
473
|
+
const version = '1.4.3';
|
|
473
474
|
const hookInst = {
|
|
474
475
|
hookFns: [],
|
|
475
476
|
filters: []
|
|
@@ -724,6 +725,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
724
725
|
dispatchEvent(e) {
|
|
725
726
|
e.stopImmediatePropagation = stopImmediatePropagation;
|
|
726
727
|
defineProp(e, 'target', () => this.proxyXhr);
|
|
728
|
+
defineProp(e, 'currentTarget', () => this.proxyXhr);
|
|
727
729
|
this.proxyEvents[e.type] && this.proxyEvents[e.type].forEach(fn => {
|
|
728
730
|
this.resThenable.then(() => !e.ajaxHooker_isStopped && fn.call(this.proxyXhr, e));
|
|
729
731
|
});
|
|
@@ -733,7 +735,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
733
735
|
}
|
|
734
736
|
setRequestHeader(header, value) {
|
|
735
737
|
this.originalXhr.setRequestHeader(header, value);
|
|
736
|
-
if (this.
|
|
738
|
+
if (!this.request) return;
|
|
737
739
|
const headers = this.request.headers;
|
|
738
740
|
headers[header] = header in headers ? `${headers[header]}, ${value}` : value;
|
|
739
741
|
}
|
|
@@ -3062,7 +3064,7 @@ System.register('Utils', [], (function (exports) {
|
|
|
3062
3064
|
UtilsCore.init(option);
|
|
3063
3065
|
}
|
|
3064
3066
|
/** 版本号 */
|
|
3065
|
-
version = "2024.6.
|
|
3067
|
+
version = "2024.6.16";
|
|
3066
3068
|
addStyle(cssText) {
|
|
3067
3069
|
if (typeof cssText !== "string") {
|
|
3068
3070
|
throw new Error("Utils.addStyle 参数cssText 必须为String类型");
|