javascript - 插件中的全局错误处理程序阻止页面在 Firefox 中加载
问题描述
我有一个 Firefox 插件,它onerror
在脚本中有一个全局处理程序,content.js
如下所示:
window.onerror = error => {
console.log('On Error Handler');
console.log(error);
}
这在任何其他站点似乎都不是问题。但是当我尝试登录https://www.mint.com时,登录后它不会加载页面。这仅在 Firefox 中发生,并且仅适用于该网站(据我所知)。如果我注释掉onerror
处理程序,它会起作用。
当页面未加载时,我看到这两个错误:
Error: Permission denied to access property "apply"
TypeError: window.ADRUM.events.VPageView is not a constructor
有没有人遇到过这个问题,或者知道为什么onerror
处理程序会导致问题?
这是我为测试问题而创建的一个简单的 Firefox 插件:ff-addon-example
解决方案
推荐阅读
- docker - wsarecv:现有连接被远程主机强行关闭?
- python - Django url传递未知数量的参数
- c++ - C++ 如何同时删除位于两个向量中的 2 个指针?
- r - 如何从较大的数据集中创建较小的矩阵?
- android - 在 Android+NDK 上将短数组转换为浮点数
- sql - FoxPro:将任意数量的视图附加到单个视图或表中
- c++ - Halide:X86 汇编代码生成
- javascript - 如何为 Google Chrome 创建可更改 URL 的扩展程序
- firebase - Android 和 iOS 设备上的最佳设置是什么,以保证 FCM 推送通知的最佳交付水平
- c# - Castle Windsor 通用类型注册