开发者

how to add a jquery plugi for firefox-extension-developlment using add-on builder

I'm writing a firefox extension and want to solve this problem: how to know when the DOM of an iFrame is ready again after changing its content? I found this Plugin which probably will solve my problem. But I don't know how to add this in my add-builder.

My problem is here:

/*********************************开发者_如何学运维***************************
            You must specify the path to your jquery.js file below! 
    *************************************************************/

    var jQueryPath = "/main/inc/lib/javascript/jquery.js";

the path for the jquery.js is different for every user because it's inside the firefox context, for example:

C:\Users\myname\AppData\Roaming\Mozilla\Firefox\Profiles\im0woiy2.default\flightdeck\resources\jid0-rxgsbnpfxdmtfgdq504rka9xktm-at-jetpack-privatsphaere_tool-data\jquery-1.6.4.js

so how can I add this plugin?


You use the self package of the add-on SDK:

var {data} = require("self");
var jQueryPath = data.url("jquery.js");

And you put jquery.js into the data/ directory of your add-on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜