Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery and Chrome Extensions [closed]

Is it smart to use jQuery as a JavaScript library in Chrome Extensions? jQuery and other DOM libraries are intended to hide the differences between browsers, and since I'm targeting Chrome only, should I use it?

like image 482
Alon Gubkin Avatar asked Jul 19 '11 04:07

Alon Gubkin


2 Answers

There are no reasons to not use jQuery on one of your extension pages (background, popup, options etc). You should always use a local jQuery copy though, not load a remotely hosted one through http.

I would advise against injecting jQuery as a content script though, if possible. If all you need is some simple selector or event listener, injecting around 100kb of js code on each page visit is a bit of an overkill.

like image 50
serg Avatar answered Oct 19 '22 22:10

serg


I use it for my Chrome extensions and I think it is very smart. jQuery is more than just hiding differences. It is full of features that allow you to code faster and more robustly. There are tons of extensions that allow you to extend your scripts. I think you would be hurting yourself by not using it!

like image 34
mrtsherman Avatar answered Oct 19 '22 22:10

mrtsherman