views:

225

answers:

2

Hi,

I'm trying to create a Firefox plugin and I would like to use some jQuery functions. How to include needed jQuery libraries? Some way to include the libraries to the plugin itself?

I need to show a jQuery Dialog type window on various web sites when user clicks a link injected to the page.

Thank you for your answers!

+1  A: 

In your overlay.xul file, just include it as if you were including any other Javascript file:

<script type="application/x-javascript" src="chrome://my-firefox-extension/content/path/to/jquery.js" />
John Feminella
+1  A: 

I suggest using chrome dialogs instead of jQuery. I've written a similar extension, though I didn't use a jQuery, but dialog code written by myself. The problem is that when you inject your html dialog inside some random page, in many cases it will come distorted because of unpredictable clashes with the loaded site CSS. Even when using inline styles and all other tricks.

In the end, I've looked how Google notebook extension is implemented and used the same idea. It worked great.

Eugene Morozov