How to console.log the version of JavaScript libraries on your browser
During a web assessment is common to find some outdated JavaScript library. I like to showcase the version of the outdated library in a console print with the URL where it loaded. Below is the list of console commands, to get their versions.
ace-builds
ace.version
//'1.32.6'
Angular
getAllAngularRootElements()[0].attributes["ng-version"].value
//'7.2.11'
AngularJS
angular.version
//{full: '1.5.6', major: 1, minor: 5, dot: 6, codeName: 'arrow-stringification'}
Bootstrap
$.fn.tooltip.Constructor.VERSION
//'3.4.1'
CKEditor
CKEDITOR.version
//'4.18.0'
DataTables
$.fn.DataTable.version
//'1.10.25'
D3.js
This worked up to version 6.7.0. After the release 7.0.0, the version is not exposed.
d3.version
//'6.6.0'
Dojo
[dojo.version.major, dojo.version.minor, dojo.version.patch].join(".");
//'1.10.1'
Fingerprint.js
Fingerprint2.VERSION
//'2.0.0'
Foundation
Foundation.version
//'5.2.1'
GSAP
gsap.version
//'3.10.4'
HAMMER.js
Hammer.VERSION
//'2.0.8'
Handlebars
Handlebars.VERSION
//'4.7.7'
Highcharts
Highcharts.version
//'10.0.0'
jQuery
$.fn.jquery
// '1.10.2'
$().jquery;
// '1.10.2'
jQuery Mobile
$.mobile.version
'1.3.1'
jQuery-UI
$.ui.version
'1.8.1'
Lightstreamer
Lightstreamer.version
//'8.0.1'
Moment.js
moment.version
//'2.10.1'
Numbro
numbro.version
//'1.5.1'
OpenUI5
sap.ui.version
//'10.2.33'
Requirejs
requirejs.version
//'2.3.2'
Three.js
THREE.REVISION
//'85'
Underscore.js
_.VERSION
//'1.13.4'