I'm having major problems when I decided to port a Chrome extension to Firefox. One of the problems is that jQuery won't install itself in the "Lib/main.js" file. The error I get is the following:
ReferenceError: window is not defined
It seems that the window object is just not defined at the main method of a Firefox Add-On.
I understand that the extension itself doesn't need a committed window object because it doesn't represent an html page. But this makes it impossible to install jQuery while I want to take advantage of the ajax method and search-algorithm in dom elements.
I've tried several methods but they all failed:
- Retrieve the window object from an active tab (Failed to send the window-element because the sendMessage() method is part of the window-object)
- document.createElement (Failed because there is also no document-object)
- Some random stuff which also failed
So my question is, does anyone have successfully install jQuery in the main method of a Firefox Add-On?