【问题标题】:Thunderbird extension: accessing the value of mail-urlfield (xbl element)Thunderbird 扩展:访问 mail-urlfield 的值(xbl 元素)
【发布时间】:2015-10-21 22:31:23
【问题描述】:

我正在使用 Thunderbird 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"/>

这个mail-urlfield被定义为https://github.com/mozilla/releases-comm-central/blob/a9cb7a6e8097e08c81eea8b3927fa82389a8a515/mail/base/content/mailWidgets.xml中的一个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 ...)

【问题讨论】:

    标签: javascript plugins xul thunderbird


    【解决方案1】:

    好的,明白了:

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

    【讨论】:

    • 请考虑编辑您的帖子,以添加更多关于您的代码的作用以及它为何能解决问题的说明。大部分只包含代码的答案(即使它正在工作)通常不会帮助其他人理解问题。
    猜你喜欢
    • 2012-07-08
    • 1970-01-01
    • 1970-01-01
    • 2014-02-14
    • 1970-01-01
    • 2017-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多