pb-sxp-ui 1.16.22 → 1.16.23
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.cjs +35 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +35 -20
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +35 -20
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +4 -4
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/context/SxpDataSourceProvider.js +35 -20
- package/lib/core/context/SxpDataSourceProvider.js +35 -20
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -889,26 +889,6 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
889
889
|
try {
|
890
890
|
// 1. 先执行原始请求
|
891
891
|
const response = _originalFetch.apply(this, arguments_1);
|
892
|
-
if (url.includes('https://i.giesswein.com/nb-collector')) {
|
893
|
-
if ((init === null || init === void 0 ? void 0 : init.method) === 'POST' && typeof (init === null || init === void 0 ? void 0 : init.body) === 'string') {
|
894
|
-
try {
|
895
|
-
const payload = JSON.parse(init.body);
|
896
|
-
if (payload && Array.isArray(payload.data)) {
|
897
|
-
payload.data.forEach((item) => {
|
898
|
-
if (item && item.e) {
|
899
|
-
bffCollectEvent({
|
900
|
-
eventName: item.e,
|
901
|
-
eventSource: 'Northbeam Pixel'
|
902
|
-
});
|
903
|
-
}
|
904
|
-
});
|
905
|
-
}
|
906
|
-
}
|
907
|
-
catch (e) {
|
908
|
-
console.error('Failed to parse Northbeam event', e);
|
909
|
-
}
|
910
|
-
}
|
911
|
-
}
|
912
892
|
// 检查是否是 GA4 收集端点
|
913
893
|
if (url.includes('https://www.google-analytics.com/g/collect')) {
|
914
894
|
const urlObj = new URL(url);
|
@@ -951,6 +931,41 @@ const SxpDataSourceProvider = ({ render, dataSources, utmVal, enableReportEvent
|
|
951
931
|
});
|
952
932
|
};
|
953
933
|
}, [bffCollectEvent]);
|
934
|
+
React.useEffect(() => {
|
935
|
+
const originalOpen = XMLHttpRequest.prototype.open;
|
936
|
+
const originalSend = XMLHttpRequest.prototype.send;
|
937
|
+
XMLHttpRequest.prototype.open = function (method, url) {
|
938
|
+
this._url = url;
|
939
|
+
originalOpen.apply(this, arguments);
|
940
|
+
};
|
941
|
+
XMLHttpRequest.prototype.send = function (body) {
|
942
|
+
if (this._url && typeof this._url === 'string' && this._url.includes('https://i.giesswein.com/nb-collector')) {
|
943
|
+
if (body && typeof body === 'string') {
|
944
|
+
try {
|
945
|
+
const payload = JSON.parse(body);
|
946
|
+
if (payload && Array.isArray(payload.data)) {
|
947
|
+
payload.data.forEach((item) => {
|
948
|
+
if (item && item.e) {
|
949
|
+
bffCollectEvent({
|
950
|
+
eventName: item.e,
|
951
|
+
eventSource: 'Northbeam Pixel'
|
952
|
+
});
|
953
|
+
}
|
954
|
+
});
|
955
|
+
}
|
956
|
+
}
|
957
|
+
catch (e) {
|
958
|
+
console.error('Failed to parse Northbeam event from XHR', e);
|
959
|
+
}
|
960
|
+
}
|
961
|
+
}
|
962
|
+
originalSend.apply(this, arguments);
|
963
|
+
};
|
964
|
+
return () => {
|
965
|
+
XMLHttpRequest.prototype.open = originalOpen;
|
966
|
+
XMLHttpRequest.prototype.send = originalSend;
|
967
|
+
};
|
968
|
+
}, [bffCollectEvent]);
|
954
969
|
React.useEffect(() => {
|
955
970
|
if (typeof (window === null || window === void 0 ? void 0 : window.fbq) === 'function') {
|
956
971
|
window === null || window === void 0 ? void 0 : window.fbq('track', 'PageView');
|