简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM