Reputation: 25028
I am making a simple chrome extension that is supposed to show me the time in a popup. I am using online resources from here and there to learn. Here is my manifest:
{
"manifest_version": 2,
"name": "Time Machine",
"version": "1.0",
"description": "Get the right time, always!",
"browser_action": {
"default_icon": "icon19.png",
"popup" : "popup.html"
}
}
and popup.html
<!DOCTYPE HTML>
<html>
<style>
body, html{
height : 100%;
}
body{
display : flex;
display : -webkit-flex;
flex-direction : row;
-webkit-flex-direction : row;
justify-content : center;
align-items : center;
}
.maincontent{
width : 100%;
display : flex;
display : -webkit-flex;
flex-direction : row;
-webkit-flex-direction : row;
justify-content : center;
align-items : center;
}
</style>
<title>Time Machine</title>
<body>
<div class="maincontent">
<p id="time"></p>
</div>
</body>
<script>
var time = document.getElementById("time");
window.onload = function(){
time.innerHTML = Date();
}
setInterval(function(){ time.innerHTML = Date(); },1000);
</script>
</html>
However, on clicking the icon after loading the unpacked chrome extension, nothing happens. I don't see the popup. What is going wrong?
Upvotes: 4
Views: 580
Reputation: 25028
"popup" : "popup.html"
needs to be changed to
"default_popup" : "popup.html"
Upvotes: 3