H
HopfZ
I am trying to make a bookmarklet to enlarge textarea in Gmail. But I
can't get to the textarea.
When you are composing a message in Gmail, the page has two frames. the
first frame has name "main". That frame contains a textarea named
"msgbody" in which you compose messages.
I have tried with Firebug getElementsByTagName and getElementsByName
but all fails.
self.main.document.getElementsByTagName('textarea') returns empty list.
self.main.document.getElementsByName('msgbody') also returns empty
list.
I suspect that it is because the textarea is buried deep in the DOM
tree.
The dom path from the main frame to the textarea is:
/html/body/table/tbody/tr[2]/td[2]/form/table/tbody/tr[5]/td/div[3]/table/tbody/tr[2]/td[2]/textarea
However the dom path from the main frame to the first div element is
/html/body/div
and self.main.document.getElementsByTagName('div') returns a nonempty
list.
can't get to the textarea.
When you are composing a message in Gmail, the page has two frames. the
first frame has name "main". That frame contains a textarea named
"msgbody" in which you compose messages.
I have tried with Firebug getElementsByTagName and getElementsByName
but all fails.
self.main.document.getElementsByTagName('textarea') returns empty list.
self.main.document.getElementsByName('msgbody') also returns empty
list.
I suspect that it is because the textarea is buried deep in the DOM
tree.
The dom path from the main frame to the textarea is:
/html/body/table/tbody/tr[2]/td[2]/form/table/tbody/tr[5]/td/div[3]/table/tbody/tr[2]/td[2]/textarea
However the dom path from the main frame to the first div element is
/html/body/div
and self.main.document.getElementsByTagName('div') returns a nonempty
list.