[英]Google Chrome Extension Running Twice
I am working on an extension for Google Chrome and I realized that my extension will run twice if I include the following in the manifest: 我正在开发Google Chrome扩展程序,但我意识到,如果清单中包含以下内容,则该扩展程序将运行两次:
"background":{"page": "popup.html","persistent": true},
However I need the .html file to run in the background in order to load data, if anymore information is required please do let me know. 但是,我需要.html文件在后台运行以加载数据,如果需要更多信息,请告诉我。
Edit 1: I have only added the following scripts in HTML, if that gives a clue. 编辑1:如果可以提供线索,我仅在HTML中添加了以下脚本。
<link rel="stylesheet" type="text/css" href="popup.css">
<script src="jquery-3.2.1.js"></script>
<script src="popup.js"></script>
Thank you! 谢谢!
In the popup.html
you might have included jquery.min.js twice. 在
popup.html
您可能两次包含了jquery.min.js。 This will result running all $(document).ready()
events twice 这将导致两次运行所有
$(document).ready()
事件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.