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

main
LiaoYijun 1 month ago
parent 653e3cc095
commit 081dd2a172

@ -44,6 +44,12 @@ export const loadPageSpy = (title) => {
window.$pageSpy = new PageSpy(PageSpyConfig); window.$pageSpy = new PageSpy(PageSpyConfig);
window.onerror = async function (msg, url, lineNo, columnNo, error) { window.onerror = async function (msg, url, lineNo, columnNo, error) {
// 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 // 3
const now = Date.now() const now = Date.now()
await window.$harbor.uploadPeriods({ await window.$harbor.uploadPeriods({
@ -52,6 +58,7 @@ export const loadPageSpy = (title) => {
remark: `\`onerror\`自动上传. ${msg}`, remark: `\`onerror\`自动上传. ${msg}`,
}) })
} }
}
}); });
}; };

Loading…
Cancel
Save