错误
错误1:Cannot set properties of null (setting ‘onclick‘)
错误2:Unchecked runtime.lastError: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
解决方法
常规检查:使用未命名的变量、会报错。我安装了Eslint所以我的代码应该是没有问题的。
看了一篇文章如下
点击这里
受到启发发现油猴插件(通用阅读器)会导致此问题,直接使用排除此网站。一路畅通。
原因
油猴插件就是js脚本运行在网站上。所以脚本报错也会打印在控制台(并非我的代码问题啊)