简体   繁体   English

如何使用附加组件生成器为firefox-extension-developlment添加jquery插件

[英]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? 我正在写一个firefox扩展,想要解决这个问题: 如何知道iFrame的DOM何时在更改其内容后再次准备好了? 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: jquery.js的路径对于每个用户都是不同的,因为它位于firefox上下文中,例如:

C:\\Users\\myname\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\im0woiy2.default\\flightdeck\\resources\\jid0-rxgsbnpfxdmtfgdq504rka9xktm-at-jetpack-privatsphaere_tool-data\\jquery-1.6.4.js C:\\ Users \\用户MYNAME \\应用程序数据\\漫游\\ Mozilla的\\火狐\\概况\\ im0woiy2.default \\驾驶舱\\资源\\ jid0-rxgsbnpfxdmtfgdq504rka9xktm-AT-传送插座-privatsphaere_tool数据\\ jQuery的1.6.4.js

so how can I add this plugin? 那我怎么能添加这个插件呢?

You use the self package of the add-on SDK: 您使用附加SDK的self

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

And you put jquery.js into the data/ directory of your add-on. 然后将jquery.js放入加载项的data/目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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