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?
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With