簡體   English   中英

Thunderbird擴展:訪問mail-urlfield的值(xbl元素)

[英]Thunderbird extension: accessing the value of mail-urlfield (xbl element)

我正在使用雷鳥API,並且試圖創建一個按鈕來在RSS面板內“警告(url)”原始網站的內容。 據我所知,該元素位於https://github.com/mozilla/releases-comm-central/blob/master/suite/mailnews/msgHdrViewOverlay.xul

 <mail-urlfield id="expandedcontent-baseBox" label="&originalWebsite.label;" collapsed="true"/>

https://github.com/mozilla/releases-comm-central/blob/a9cb7a6e8097e08c81eea8b3927fa82389a8a515/mail/base/content/mailWidgets.xml中,此mail-urlfield被定義為XUL綁定

 <binding id="mail-urlfield" extends="chrome://messenger/content/mailWidgets.xml#mail-headerfield">
    <content>
      <xul:description
                 onclick="if (event.button != 2)
                            openUILink(event.target.textContent, event);"
                 class="headerValue text-link headerValueUrl"
                 anonid="headerValue" flex="1" readonly="true"
                 role="textbox" aria-readonly="true" context="copyUrlPopup"/>
    </content>
  </binding>

document.getElementById返回“ mail-urlfield”,但是我可以獲取元素的值(“ http:// ....”)嗎? (我嘗試了elt.label,elt.value ...)

好的,我知道了:

var x = document.getElementById("expandedcontent-baseBox");
var y = document.getAnonymousElementByAttribute(x,"anonid","headerValue");
var www = y.textContent ;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM