fix:解决当页面有 iframe 时PageSpy rrweb 会报错

main
LiaoYijun 1 month ago
parent 653e3cc095
commit 081dd2a172

@ -44,13 +44,20 @@ export const loadPageSpy = (title) => {
window.$pageSpy = new PageSpy(PageSpyConfig);
window.onerror = async function (msg, url, lineNo, columnNo, error) {
// 3
const now = Date.now()
await window.$harbor.uploadPeriods({
startTime: now - 3 * 60000,
endTime: now,
remark: `\`onerror\`自动上传. ${msg}`,
})
// iframe rrweb Cannot set property attributeName of #<MutationRecord> which has only a getter
//
if (url && url.indexOf('https://page-spy.mycht.cn/plugin/rrweb/index.min.js') > -1) {
console.info('ignore rrweb error')
} else {
// 3
const now = Date.now()
await window.$harbor.uploadPeriods({
startTime: now - 3 * 60000,
endTime: now,
remark: `\`onerror\`自动上传. ${msg}`,
})
}
}
});
};

Loading…
Cancel
Save