gpt4 book ai didi

javascript - 移动版 Safari 中的 TypeError : Illegal invocation in the pubads_impl_XXX. js

转载 作者:行者123 更新时间:2023-12-04 08:42:24 27 4
gpt4 key购买 nike

我有一个使用 DoubleClick 的网站。在 Sentry(错误跟踪)中,pubads_impl_xxx.js 中存在一些错误,但仅限于 Mobile Safari。这是为什么?我应该忽略它们还是有什么方法可以修复它们?

谢谢

TypeError: Illegal invocation
at HTMLDocument.document.createEvent(:1:40918)
at Wc.l(/gpt/pubads_impl_2020101501.js:6:89381)
at $c(/gpt/pubads_impl_2020101501.js:6:15725)
at bd.next(/gpt/pubads_impl_2020101501.js:6:16017)
at ? (/gpt/pubads_impl_2020101501.js:6:29861)
at new Promise(<anonymous>)
at Xa(/gpt/pubads_impl_2020101501.js:6:29629)
at Po.jn.dispatchEvent(/gpt/pubads_impl_2020101501.js:6:89295)
at cz._.q.Yb(/gpt/pubads_impl_2020101501.js:6:262763)
at Object.<anonymous>(/gpt/pubads_impl_2020101501.js:6:120833)

最佳答案

这似乎是一个已知的 ISSUE 1811 sentry-javascript 并且与 blacklistUrls 有关,在 iOS9 Mobile Safari 上不工作。

建议的解决方案是更新 blacklistUrls 以使用正则表达式或处理 beforeSend 回调中的检查。

在问题附带的代码中,由于 facebook 爬虫而发生错误,您可以进行类似的检查以找出 Google 爬虫正在使用的 url。

Sentry.init({
beforeSend: function (event) {
// Drop all events if query string includes `fbclid` string
if (location.search.indexOf('fbclid') !== -1) return null;
// Otherwise just let it though
return event;
}
});

关于javascript - 移动版 Safari 中的 TypeError : Illegal invocation in the pubads_impl_XXX. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64497012/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com