I'm trying to create an extension where I can do a one-word google search.
This is the manifest:
{
"manifest_version": 2,
"name": "GoogleSearch",
"description": "GoogleSearch",
"version": "1.0",
"browser_action":{
"default_popup": "popup.html",
"default_title": "GoogleSearch"
},
"permissions": ["tabs"]
}
And this is the part of the code in the popup.html I couldn´t make it work:
<input type="text" class="form-control" id="inputWord" placeholder="Word">
<button id ="btn" onclick="doSearch()">Search</button>
<script>
function doSearch() {
let word = document.querySelector('#inputWord').value;
window.open("https://www.google.com.uy/search?q=" + word);
}
</script>
So when I click the button, nothing happens.