I've tried to create a simple google-chrome-extension for a custom new tab.
I've used two files to do it:
manifest.json:
{
"name": "focus",
"version": "0.2",
"chrome_url_overrides": {
"newtab": "new.html"
},
"manifest_version": 2
}
new.html
<!DOCTYPE html>
<html>
<head>
<script>
function setFocus()
{
document.getElementById("fname").focus();
}
</script>
</head>
<body onload="setFocus()">
<form>
Search: <input type="text" id="fname" size="30"><br>
</form>
</body>
</html>
After I install those files as a chrome-extension I open a new tab. It works but the focus is on address bar (omnibox) and NOT on search textbox.
How can I set the focus on search textbox?
thanks