JavaScript 时钟现在显示在我的 chrome 扩展程序中

JavaScript clock now showing in my chrome extension

您好,在我的 chrome 扩展(NewTab)中,我的 JavaScript 时钟不会显示,但是当我 运行 实际文件时,它 loads.Please 帮助我尝试重新加载并重新打包,但它仍然不会 work.It 为日期时分秒创建一个变量,然后添加它 together.Code:

<!DOCTYPE HTML>

<head>

<style>
.verticlecenter {
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
}

.button {
background-color: #4CAF50; /* Green */
border: none;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
-webkit-transition-duration: 0.4s; /* Safari */
transition-duration: 0.4s;
cursor: pointer;
border-radius: 25px;
}

.button2 {
background-color: white; 
color: black; 
border: 2px solid #008CBA;
}

.button2:hover {
background-color: #008CBA;
color: white;
}

input[type=text] {
 width: 250px;
 box-sizing: border-box;
 border: 2px solid #ccc;
 border-radius: 4px;
 font-size: 16px;
 background-color: white;
 padding: 12px 20px 12px 10px;
 -webkit-transition: width 0.4s ease-in-out;
  transition: width 0.4s ease-in-out;
text-align: center;
}

body {
background: #3A1C71;  /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #FFAF7B, #D76D77, #3A1C71);      /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #FFAF7B, #D76D77, #3A1C71); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
</style>

<script>
function startTime() {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
m = checkTime(m);
s = checkTime(s);
document.getElementById('txt').innerHTML =
h + ":" + m + ":" + s;
var t = setTimeout(startTime, 500);
}

function checkTime(i) {
if (i < 10) {i = "0" + i};  // add zero in front of numbers < 10
return i;
}
</script>

</head>

<body onload="startTime()">
<div id="txt"></div>
<div class="verticlecenter">
<center>
<form method="get" action="http://www.google.com/search">
<input type="text" name="q" size="25" maxlength="255" value=""     placeholder="Google Search" /><br>
<input class="button button2" type="submit" value="Search" /></td></tr>
</center>
</div>

</body>

清单文件:

{

"name": "tangoethan's NewTab",
"version": "1.0",
"manifest_version": 2,
"description": "tangoethan's newtab made by tangoethan",
"browser_action":{
    "default_icon": "icon.png"
},
"chrome_url_overrides": {
"newtab": "newtab.html"
  }
}

我找到了答案,代码中有一个额外的冒号阻止 chrome 从扩展中读取它。