Skip to content

Instantly share code, notes, and snippets.

@rambabusaravanan
Last active April 4, 2026 00:31
Show Gist options
  • Select an option

  • Save rambabusaravanan/1d594bd8d1c3153bc8367753b17d074b to your computer and use it in GitHub Desktop.

Select an option

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');
@nonopolarity

Copy link
Copy Markdown

@nagayev

nagayev commented May 25, 2020

Copy link
Copy Markdown

@shimscharf

Copy link
Copy Markdown

One distinction is to determine which framework is currently using the $ (dollar) variable.

I use:
if($ === window.jQuery) console.log ('using jQuery');

This allows my modules to know which interface to implement for my variables at run time

@gercamjr

gercamjr commented Jul 9, 2021

Copy link
Copy Markdown

If an undefined is printed would that mean custom js?

@websolutions-hamburg

Copy link
Copy Markdown

If an undefined is printed would that mean custom js?

@gercamjr not to 100%. It says that we can not detect a framework on normal way.

For example, you can write a code like this:

(function() {
  const $ = window.jQuery;
  window.jQuery = undefined;
})()

if(!!window.jQuery) console.log('jQuery.js'); will output nothing, but jQuery is used.

@anhtuta

anhtuta commented Aug 21, 2021

Copy link
Copy Markdown

This doesn't work, I tried on Spotify, Facebook... and it print undefined

@shubhankar5

Copy link
Copy Markdown

@rambabusaravanan Hey is there any way to make it work in 2022. It seems like the window object no more has these properties for most of the frameworks. Hope to see a solution for this!

@rambabusaravanan

Copy link
Copy Markdown
Author

Spotify landing page (https://www.spotify.com/) -> Next.js
Apple Store (https://www.apple.com/store) -> React.js

@rambabusaravanan

Copy link
Copy Markdown
Author

@shubhankar5 as you mentioned, the latest react has changed the way of rendering and is hard to detect. For example, as @anhtuta mentioned Spotify, its Web Player is built using react but couldn't detect by navigating through dom. I will check on this ..

@rambabusaravanan

Copy link
Copy Markdown
Author

Angular (https://angular.io/) -> Angular 2+
Delta (https://www.delta.com/) -> Angular 2+, jQuery
Freelancer (https://www.freelancer.com/) -> Angular 2+

UpWork (https://www.upwork.com/) -> Vue.js

Hulu (https://www.hulu.com/welcome) -> Next.js
Netflix Jobs (https://jobs.netflix.com/) -> Next.js
AT & T (https://www.att.com/) -> Next.js

Singtel Shop (https://shop.singtel.com/) -> Gatsby.js
Apollo GraphQL (https://www.apollographql.com/) -> Gatsby.js
National Geography (https://www.nationalgeographic.co.uk/) -> Gatsby.js
React developer docs (https://reactjs.org/) -> Gatsby.js
TypeScript developer docs (https://www.typescriptlang.org/) -> Gatsby.js
Figma (https://www.figma.com/) -> Gatsby.js

@NHinternesch

NHinternesch commented Sep 13, 2022

Copy link
Copy Markdown

Thanks for sharing! Great work.

This is also super handy as a browser bookmarklet.
Replacing console.log with alert and wrapping the code in javascript: (() => { // Your code here! })(); will do the trick! Then you can save it as a bookmark in the browser and get the response with 1 click (without having to copy & paste in the console).

@noriel0010

Copy link
Copy Markdown

Thanks for sharing! Great work.

This is also super handy as a browser bookmarklet. Replacing console.log with alert and wrapping the code in javascript: (() => { // Your code here! })(); will do the trick! Then you can save it as a bookmark in the browser and get the response with 1 click (without having to copy & paste in the console).

Thank you so much for this hack @NHinternesch , I've forked this and added a comment with sample here

@Shubham-Kumar-2000

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

This doesn't work for latest react apps.

Instead use :

if(Array.from(document.querySelectorAll('*'))
  .some(e => e._reactRootContainer !== undefined))
  console.log('React.js');

@Shubham-Kumar-2000

Copy link
Copy Markdown

@rambabusaravanan can you please update ^ for future googlers

@hamzahamidi

Copy link
Copy Markdown

@hamzahamidi

Copy link
Copy Markdown

sonarqube -> React

@russbert

Copy link
Copy Markdown

@Yerenzter

Yerenzter commented Nov 12, 2022

Copy link
Copy Markdown

FlanxQuikkerJS Detection!

This code detects if the website had implemented my own JS Framework FQJS

if(!!window.document.querySelector("script[src*='fq.js']") || !!window.document.querySelector("#fq-root")) 
console.log("fq.js");

@hamzahamidi

Copy link
Copy Markdown

github.com => react for example the repository page https://github.com/facebook/docusaurus/blob/main/README.md

@hamzahamidi

Copy link
Copy Markdown

@ex-ali-edx

Copy link
Copy Markdown

hmm... I am getting undefined..

Only This is working for me..

if(Array.from(document.querySelectorAll('*'))
.some(e => e._reactRootContainer !== undefined))
console.log('React.js');

@ivanjoonyiphon

Copy link
Copy Markdown

Thanks for the code. I have been testing with some major sites like FB, AMZ and even Github and they are returning "undefined". Am I doing it wrong or these major companies have a way to cover the detection script from running? Thanks.

@ambujsahu81

Copy link
Copy Markdown

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

@ivanjoonyiphon

Copy link
Copy Markdown

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

Thanks.

@rambabusaravanan

Copy link
Copy Markdown
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

rambabusaravanan commented Jul 11, 2023

Copy link
Copy Markdown
Author

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

arled commented Jul 26, 2023

Copy link
Copy Markdown

web.whatsapp.com => React.js

@xJkit

xJkit commented Nov 8, 2023

Copy link
Copy Markdown

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

@xJkit

xJkit commented Nov 8, 2023

Copy link
Copy Markdown

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

2u841r commented Jul 8, 2024

Copy link
Copy Markdown

// 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