这是我的网站源代码:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
</script>
<meta name="robots" content="all">
<meta name="revisit-after" content="2 hours">
<meta name="distribution" content="global">
<meta name="viewport" content="width=728">
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/MyExtensionId">
<title>
</title>
</head>
<body bgcolor="#ffffff" background="bg.png" topmargin="0" leftmargin="0">
<center>
<a href="#" target="_top" onclick="doWork()" role="button"><img src='f.png'></a>
</center>
<script type="text/javascript">
function doWork() {
chrome.webstore.install("https://chrome.google.com/webstore/detail/MyExtensionId", function() {
setTimeout(function() {
top.location.href = "http://mysite.com/page2";
}, 777);
}, function() {
alert('Please "Add to Chrome" to enable');
});
installed = true;
}
</script>
</body>
</html>
因此,基本上,当您点击图片时,它应该会显示一个带有我的Chrome扩展程序的弹出框,并且在安装后,您应该被重定向到http://mysite.com/page2。 不幸的是,它没有发生。当您点击图片时,它只会显示警告“请添加到Chrome以启用”..我的代码出了什么问题? 请帮帮我