3

I am trying to create a google search bar in a chrome extension that will open the search in a new browser tab. My manifest.json looks like this:

{
 "name": "Search",
 "version": "1.0",
 "manifest_version": 2,
 "description": "Search",
 "browser_action": {
 "default_icon": "search.png",
 "default_popup": "popup.html"
   }
}

My HTML looks like this:

<div id="search">
<form method="get" action="http://www.google.com">
<div style="border:0px solid black;padding:2px;width:20em;">
<table border="0" cellpadding="0">
<tr><td>
<input type="text"   name="q" size="25"
 maxlength="255" value=""<textarea placeholder="Search Google"></textarea>
<input type="submit" value="Search" /></td></tr>
</table>
</div>

This html page works fine in a normal browswer but not as a chrome extension. I think that I need to give permission to access my tabs but I am new to making chrome extensions so I am having a little bit of trouble with my rigid manifest.json markup.

4

1 に答える 1

3

次のように、フォームに属性を追加しtarget="_blank"ます。

<form method="get" action="http://www.google.com" target="_blank">

( MDN リファレンス)

于 2013-07-20T03:20:45.807 に答える