views:

30

answers:

1

Hi all,

I was working on a very simple extension, where on clicking extension icon, a webpage is opened in a new tab, the webpage has HTML frames, within which lies a textbox. I want to set a value for the same.

The webpage which opens has:

<HTML>
<FRAMESET rows="15%, *" border="0">
<FRAME src="./files/abc.htm" id="abc_frame" name="abc_frame" 
onload="abcLoad()" scrolling="NO">
</FRAMESET>
</HTML>

and abc.htm has:

<div align="center" valign="bottom" style="font-size: 1em;"> 
<form onSubmit="javascript:navigate(this);return false;"> 
<label for="loc">Loc</label>: 
<input type="text" size="50" id="loc" value="http://google.com"/&gt; 
<input name="go" type="submit" value="Go" id="loc_go" 
onclick='navigate(this); return false;'/> 
</form>
</div>

how can I replace current textbox value with, say http://yahoo.com ? I guess, Content Script in Chrome extensions is required, but not sure, how/what should be it's code/content. Please guide/help. Thanks a lot. Appreciate it.

+1  A: 

You should be able to.

1) set in your manifest the "all_frames" : true option. 2) you should be able to inspect the DOM of the IFRAME and then find the element in the contentWindow and simply set its value.

Kinlan