如何判断 Web 应用程序是否正在使用 ReactJs [英] How to tell if a web application is using ReactJs

查看:29
本文介绍了如何判断 Web 应用程序是否正在使用 ReactJs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有像 Wappalyzer 这样的工具 &BuiltWith 为您提供有关网站中使用的框架或库的信息.但是我需要一些关于 ReactJs 是否真的在网站中使用的证据.

I know there are tools like Wappalyzer & BuiltWith that give you information about which framework or library is used in a website. But I need some kind of proof regarding if ReactJs is really used in a website.

经过一番研究,我发现像 typeof Reactwindow.React.version 这样的命令,但这些命令并不总是有效.

After some research I found out that commands like typeof React or window.React.version, but these commands don't work all the time.

关于如何检查 reactJs 是否用于 Web 应用程序的任何想法?

Any ideas on how to check reactJs is used a web application?

推荐答案

试试下面的代码片段,感谢 rambabusaravanan 列出的每个站点的示例.见以下链接

try the below snippet, thanks for the examples for each site listed by rambabusaravanan. See the below link

if(!!window.React ||
   !!document.querySelector('[data-reactroot], [data-reactid]'))
  console.log('React.js');

if(!!window.angular ||
   !!document.querySelector('.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]') ||
   !!document.querySelector('script[src*="angular.js"], script[src*="angular.min.js"]'))
  console.log('Angular.js');

if(!!window.Backbone) console.log('Backbone.js');
if(!!window.Ember) console.log('Ember.js');
if(!!window.Vue) console.log('Vue.js');
if(!!window.Meteor) console.log('Meteor.js');
if(!!window.Zepto) console.log('Zepto.js');
if(!!window.jQuery) console.log('jQuery.js');

您可以在此处找到更多信息链接

you can find additional info here link

这篇关于如何判断 Web 应用程序是否正在使用 ReactJs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆