简体   繁体   中英

How to tell if a website is using next.js?

It's easy to tell if a website uses ReactJS, by using the React Developer Tools .

However, I know a website that uses ReactJS and Server Side Rendering (the whole page is built with React components, but the page source contains the whole HTML). Is it possible to tell if this website uses Next.js in particular for SSR?

Does Next.js leave any trace detectable on the front-end?

By default, Next.js sets the X-Powered-By header to Next.js . So if you check Chrome's devtools for a page, you can check to see if this header exists.

Note : Developers can opt-out of including this header . So if the header does not exist, it is not evidence that the website does not use Next.js

在此处输入图像描述

If you are seeing content is wrapped with id="__next", this website use next.js

like uber

在此处输入图像描述

and like netflix

在此处输入图像描述

Version of Next.js + properties of the page:

console.log({
  NextJSVersion: window.next?.version,
  pageProps: window.__NEXT_DATA__?.props?.pageProps
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM