qb-pc-sdk 1.0.4 → 1.0.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/index.js +2 -1
- package/package.json +1 -1
- package/src/ad-sdk-wrapper.js +2 -1
package/index.js
CHANGED
|
@@ -74,7 +74,8 @@ if (isBrowser && typeof window !== 'undefined' && window.console && !window.cons
|
|
|
74
74
|
// 拦截未捕获的 Promise rejection
|
|
75
75
|
const originalUnhandledRejection = window.onunhandledrejection;
|
|
76
76
|
window.addEventListener('unhandledrejection', function(event) {
|
|
77
|
-
const
|
|
77
|
+
const reason = event.reason || {};
|
|
78
|
+
const errorText = (reason.message || reason || '').toString().toLowerCase();
|
|
78
79
|
if (shouldFilter(errorText)) {
|
|
79
80
|
// 阻止默认行为,静默处理
|
|
80
81
|
event.preventDefault();
|
package/package.json
CHANGED
package/src/ad-sdk-wrapper.js
CHANGED
|
@@ -76,7 +76,8 @@
|
|
|
76
76
|
// 拦截未捕获的 Promise rejection
|
|
77
77
|
const originalUnhandledRejection = window.onunhandledrejection;
|
|
78
78
|
window.addEventListener('unhandledrejection', function(event) {
|
|
79
|
-
const
|
|
79
|
+
const reason = event.reason || {};
|
|
80
|
+
const errorText = (reason.message || reason || '').toString().toLowerCase();
|
|
80
81
|
if (shouldFilter(errorText)) {
|
|
81
82
|
// 阻止默认行为,静默处理
|
|
82
83
|
event.preventDefault();
|