You could consider using Shopify.theme.role, which should tell you if user is on a theme other than live theme, which maybe useful. Also available in liquid.
Could also check document.cookie for _ab that determines if preview bar is shown.
I would actually consider creating your own preview logic, based on a URL param, would be cleanest and easiest.
We’re appending your url with the string ?junip-preview-mode=true&junip-break-cache=true .
You can manually trigger preview mode yourself, on any page of your website, by adding that string to the end of whatever url you’re on.
How to launch the Nosto Debug Toolbar?
The Debug Toolbar can be triggered when adding ?nostodebug=true as a parameter of the store’s url. To be correctly triggered, the host must match the host as set under the Nosto’s Account Settings.