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