如何判断一个网站是否正在使用 next.js?
How to tell if a website is using next.js?
通过使用 React Developer Tools.
可以很容易地判断网站是否使用 ReactJS
不过,我知道一个使用ReactJS和Server Side Rendering的网站(整个页面都是用React组件构建的,但是页面源码包含了整个HTML)。 是否可以判断该网站是否使用 Next.js 特别是 SSR?
Next.js 是否在前端留下任何可检测到的痕迹?
默认情况下,Next.js 将 X-Powered-By
header 设置为 Next.js
。因此,如果您检查 Chrome 的页面开发工具,您可以检查此 header 是否存在。
注意:Developers can opt-out of including this header。所以如果header不存在,不能证明该网站没有使用Next.js
如果您看到内容用 id="__next" 包裹,本网站使用 next.js
喜欢优步
喜欢 netflix
版本 Next.js + 页面属性:
console.log({
NextJSVersion: window.next?.version,
pageProps: window.__NEXT_DATA__?.props?.pageProps
})
通过使用 React Developer Tools.
可以很容易地判断网站是否使用 ReactJS不过,我知道一个使用ReactJS和Server Side Rendering的网站(整个页面都是用React组件构建的,但是页面源码包含了整个HTML)。 是否可以判断该网站是否使用 Next.js 特别是 SSR?
Next.js 是否在前端留下任何可检测到的痕迹?
默认情况下,Next.js 将 X-Powered-By
header 设置为 Next.js
。因此,如果您检查 Chrome 的页面开发工具,您可以检查此 header 是否存在。
注意:Developers can opt-out of including this header。所以如果header不存在,不能证明该网站没有使用Next.js
如果您看到内容用 id="__next" 包裹,本网站使用 next.js
喜欢优步
喜欢 netflix
版本 Next.js + 页面属性:
console.log({
NextJSVersion: window.next?.version,
pageProps: window.__NEXT_DATA__?.props?.pageProps
})