如何查找网站中使用的Javascript库版本?

时间:2017-03-27 00:12:42

标签: javascript jquery angularjs node.js web

我正在尝试查找热门网站中使用的javascript库版本。

使用phantomjs.exe我能够找到jquery的信息。但我不知道如何为其他Javascript库扩展它,如angular,ninject,mochajs,reactjs和nodejs

以下是http://phantomjs.org/download.html

中phanotomjs.exe的链接

我附加了用于jquery的文件。

var page = require('webpage').create(),
    system = require('system'),
    address;
 
if (system.args.length === 1) {
    console.log('Usage: libdetect.js url');
    phantom.exit(1);
}
 
page.settings.loadImages = false;
address = system.args[1];
console.log('Loading', address, '...');
 
page.open(address, function (status) {
  if (status !== 'success') {
    console.log('ERROR: Unable to load', address);
    phantom.exit();
  } else {
    setTimeout(function () {
      var jQueryVersion;
      jQueryVersion = page.evaluate(function () {
        return (typeof jQuery === 'function') ? jQuery.fn.jquery : undefined;
      });
      if (jQueryVersion) {
        console.log('jQuery', jQueryVersion);
      } else {
        console.log('This site does not use jQuery.');
      }
      phantom.exit();
    }, 2000);
  }
});

1 个答案:

答案 0 :(得分:0)

使用angularjs版本

angular.version

使用nodejs版本

node -v

或者

node --version