Is there a way to know if the page is being viewed in Preview?

In the custom JS code, it’s possible to write a check for if the code is being executed in the Editing window, e.g. Builder.isEditing.

Is there some equivalent for knowing that the page is being viewed in the Preview feature? I would like to modify the code based on that, so that I can make a change to the page specifically when teammates are previewing a page.

Hi @jballo !

You are absolutely correcting! It is possible to do both, you can see a bit more info on previewing and editing in our docs here:
Previewing URL: isPreviewing and isEditing

Check it out and let us know if you have any further questions!