Google library API style imports


Status Graveyard
Add-on Builder
7 years ago
4 years ago


(Reporter: arky, Unassigned)





7 years ago
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: 

It would be good idea to allow developers to import jquery and other libraries with simple require viz...  

require(jquery, 1.4.x);

Reproducible: Always

Comment 1

7 years ago
Darn! Pressed the wrong button. Not a security bug, just a feature request.
Group: client-services-security
require() statements are specifically for modules that adhere to the CommonJS standard and are of use in the add-on context only. This means that require() doesn't exist in Page Mod code (and other such web content code) that is executed in web pages.

jQuery is a simple DOM DSL and offers little to nothing in the way of JavaScript language enhancement. Additionally, jQuery is not CommonJS compatible, mostly because it does not understand a non-DOM environment. If you wanted something like jQuery that could enhance your add-on code, you could use a framework that enhances the JavaScript language like MooTools. MooTools offers a "Server" build that is Node.js compatible and adheres to the CommonJS standard, you could include that to have some more advanced features within your add-ons context -
Last Resolved: 7 years ago
Resolution: --- → INVALID


4 years ago
Product: → Graveyard
You need to log in before you can comment on or make changes to this bug.