I build my first Chrome Extensions with code and file snippets below.
manifest.json
{
"name": "Test",
"version": "0.1",
"manifest_version": 2,
"description": "First try",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
}
}
popup.html
<!doctype html>
<html>
<head>
<title>Getting Started Extension's Popup</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<script src="jquery.js"></script>
<script src="popup.js"></script>
</script>
</head>
<body>
<input id="input1">
<input id="input2" type="submit">
</body>
</html>
popup.js
$(document).ready(function() {
$('#input2').click(function(){
alert('test');
var whatISearch = $('#input1').val();
//chrome.tabs.create({'url': "https://www.google.com/search?s=" + whatISearch});
window.open("https://www.google.com/search?s=" + whatISearch);
});
});
As you see,what I supposed to do is opening the google search result page in a new window with user search inputs.But unfortunately it doesnt work for me,so is there anything wrong and how can I correct this?
`.
– Rob W May 13 '13 at 16:26`, so that doesn't pose any problems. I've copy-pasted the code from your question, and it works fine. Did you reload your extension after changing the code?
– Rob W May 13 '13 at 17:16