So I made a little html file the other day and it's just a page that has a clock, gif background, and a search bar that searches Google.
I had it all working as an html file earlier but then I wanted to make it into a chrome extension. I had to make a manifest.js file and put the scripts in a separate file too and then the search wasn't working anymore.
I really have no clue what I did wrong.
Here's my manifest file:
{
"name": "THE GOODEST",
"description": "Overrides the new tab page",
"version": "0.1",
"icons": {"48": "icon.png"},
"incognito": "split",
"chrome_url_overrides": {
"newtab": "newTab.html"
},
"manifest_version": 2
}
Here's my html file:
<!DOCTYPE html>
<html>
<title>New Tab</title>
<body onload = "resizeWindow()">
<iframe src="http://free.timeanddate.com/clock/i63s4yyj/n224/ahl/avb/pa10/tt0/tw1/tm1/ts1" frameborder=0 width="195" height="37" style="position:fixed; bottom: 10px"></iframe>
<input id="searchBar">
<button onclick="search()">Search</button>
<script type = "text/javascript" src = "scripts.js"></script>
</body>
</html>
And here's my script:
function search() {
var text = document.getElementById("searchBar").value;
window.open("https://www.google.com/search?q=" + text)
}