MozillaZine

javascript elementid for To field in composer window

Talk about add-ons and extension development.
ElPazzo
 
Posts: 21
Joined: May 29th, 2005, 3:16 am
Location: Wien

Post Posted April 12th, 2019, 9:03 am

Hi,

How can I get the value of To (CC) field in composer window when developing an addon? Or is there an extensive list of all elementids?

My searches on Google did not really return any interesting results. :(

regards,
Pascal

morat
 
Posts: 3384
Joined: February 3rd, 2009, 6:29 pm

Post Posted April 12th, 2019, 11:09 am

Try these:

Code: Select all
AddRecipient("addr_to", "foo bar <test@invalid.com>");

Code: Select all
var row = 1;
var popup = awGetPopupElement(row);
var input = awGetInputElement(row);

alert(popup.label); // To:
alert(popup.value); // addr_to
alert(input.value); // foo bar <test@invalid.com>

Reference
http://dxr.mozilla.org/comm-release/sou ... ommands.js
http://dxr.mozilla.org/comm-release/sou ... Overlay.js

DOM Inspector Plus!
http://addons.thunderbird.net/thunderbird/addon/254571
http://developer.mozilla.org/docs/Tools/Add-ons/DOM_Inspector

ElPazzo
 
Posts: 21
Joined: May 29th, 2005, 3:16 am
Location: Wien

Post Posted April 15th, 2019, 3:15 am

Hi Morat,

Sorry, I don't get it. DOM inspector does not work on composewindow and in the reference you posted I do not really see how to get To-field or how to set/change it. You example would only be helpful if I wanted to add a new addressee.

What I want to do is get To and/or CC field and check against some domains, if true, than change address to whatever address I set as string.

regards,
Pascal

morat
 
Posts: 3384
Joined: February 3rd, 2009, 6:29 pm

Post Posted April 15th, 2019, 10:04 am

DOM Inspector Plus! works in the compose window in Thunderbird 60.

Here is how to select an element in DOMi.

* 3pane window, File > New > Message ( i.e. open compose window )
* 3pane window, Tools > DOM Inspector
* DOMi window, File > Inspect Chrome Document > chrome://messenger/content/messengercompose/messengercompose.xul picture
* DOMi window, click "Find a node to inspect by clicking on it" button (top left)
* compose window, click "To:" field

morat
 
Posts: 3384
Joined: February 3rd, 2009, 6:29 pm

Post Posted April 15th, 2019, 10:39 am

Are you asking for the element id for the "To:" field in the compose window in the original post?

The id for the recipient type popup element for row 1 is "addressCol1#1".
The id for the recipient input element for row 1 is "addressCol2#1".

Reference
http://dxr.mozilla.org/comm-release/sou ... Overlay.js

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 2 guests