Skip to content

Instantly share code, notes, and snippets.

@rambabusaravanan
Last active September 14, 2024 03:06
Show Gist options
  • Save rambabusaravanan/1d594bd8d1c3153bc8367753b17d074b to your computer and use it in GitHub Desktop.
Save rambabusaravanan/1d594bd8d1c3153bc8367753b17d074b to your computer and use it in GitHub Desktop.
Detect JS Framework used in a Website
// Paste these lines into website's console (Win/Linux: Ctrl + Shift + I / Mac: Cmd + Alt + I)
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]') ||
Array.from(document.querySelectorAll('*')).some(e => e._reactRootContainer !== undefined || Object.keys(e).some(k => k.startsWith('__reactContainer')))
)
console.log('React.js');
if(!!document.querySelector('script[id=__NEXT_DATA__]'))
console.log('Next.js');
if(!!document.querySelector('[id=___gatsby]'))
console.log('Gatsby.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.getAllAngularRootElements || !!window.ng?.coreTokens?.NgZone)
console.log('Angular');
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');
@ivanjoonyiphon
Copy link

you could also try to use js-framework-detector which does the same thing but supports more libraries. Reference code

Thanks.

@rambabusaravanan
Copy link
Author

Thanks @Shubham-Kumar-2000, updated it.

Also some new react versions, have property like __reactContainer<random> instead of just _reactRootContainer.
Updated them as well for newer react 👍

@rambabusaravanan
Copy link
Author

rambabusaravanan commented Jul 11, 2023

With the new react update,

https://www.apple.com/store => React.js
https://open.spotify.com/ => React.js
https://react.dev/ => React.js, Next.js
https://www.gatsbyjs.com/ => React.js, Gatsby.js
https://developer.mozilla.org/en-US/ => React.js
https://www.facebook.com/ => React.js
https://www.flipkart.com/ => React.js

https://www.intercom.com/ => React.js, Next.js
https://goldenpi.com/ => Angular

@arled
Copy link

arled commented Jul 26, 2023

web.whatsapp.com => React.js

@xJkit
Copy link

xJkit commented Nov 8, 2023

The detection method of Vue is not working on this site:
https://www.bilibili.com/

@xJkit
Copy link

xJkit commented Nov 8, 2023

The detection method of Vue is not working on this site: https://www.bilibili.com/

if(!!window.__VUE__) console.log('Vue.js');

I just tried this method. It's workable.

@2u841r
Copy link

2u841r commented Jul 8, 2024

// Svelte.js detection

if(!!document.querySelector('[data-svelte-h]') || !!document.querySelector('sveltekit-endpoint, sveltekit-app'))
  console.log('Svelte.js/SvelteKit');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment