Though your safer option would be the second method. Once you have found your window, it's very easy to edit the text in it, the hard part is finding it. To find one particular text box on a web browser, you have to know exactly what you're looking for (probably most accomplishable using EnumWindows). This is a tricky thing for a beginner, so I suggest you learn some basics first.
Though, on second thought, I'm not entirely sure how controls in web browsers work, so the second method may not work at all.