Open redxtech opened 3 years ago
I must admit I haven't used this project in a while myself, but I believe this is possible. You should have a global window.SNAPSHOT = true
injected into the page when running. https://github.com/errorception/snapshotify/blob/3a6bc0d50ea1d48ed110f792cb0104d00299133b/src/process-path.js#L36
Yeah, this is documented in the README too:
Detecting snapshot
Sometimes, it may be necessary to detect if you are running in the snapshot mode, so that you can serve up alternative content. To enable this, a global window.SNAPSHOT variable is set to true when taking the snapshot.
Hello! Is there any way for the app to tell whether it's being prerendered? I know that in
react-snap
you can check withnavigator.userAgent === 'ReactSnap'
, so I'm wondering if there's an equivalent for this prerenderer. Thanks \:)