FireFox extension: How to access page element via jQuery?

后端 未结 1 1505
被撕碎了的回忆
被撕碎了的回忆 2020-12-20 09:40

I am using following code:

   var myExtension = {
    init: function() {
        // The event can be DOMContentLoaded, pageshow, pagehide, load or unload.
           


        
相关标签:
1条回答
  • 2020-12-20 09:51

    $() will use the document of the current window by default. Which is actually browser.xul in your case. You need to operate on the sub-document, which you already got via var doc = aEvent.originalTarget;, so this should work I think (untested)

    $(doc).find("#blueBar")
    
    0 讨论(0)
提交回复
热议问题