Is there a way to identify if the javascripts included in the website are libraries ?
I mean, the websites generally load several javascript files using
tag… I want to know if the file which is being loaded is library (like jquery) or if it is a normal javascript.
Is there a way to find this?
Thanks in advance,
Irfan
There isn’t any difference between a javascript file and a “library”, they are just normal javascript files. You can’t differentiate them.
Infact your logical way to identify libraries is from well known names and not from a specific parameter.
If you want you can implement a method that looks for well known names, but someone can also rename their javascript files to make them look like libraries for your script.
There is another important note: in rails (for example), all javascript files can be merged into a single one to preserve bandwith usage (they are uglyfied), so maybe you will have name like “v9834kc90l2d0vk34r5lcve.js” which also contains a library. I don’t think you can identify it easily.
Why are you doing this by the way?