I have some JavaScript running that on my page that I DON’T want to run in Pinegrow (even when JS is enabled). How do I do this?
is there a class or element somewhere that exists only within the Pinegrow interface that I can check against? I’m sure there’s a way to find this out myself so a lil help on how to look inside Pinegrow would be fab! Otherwise, for now, I’m checking if the URL is localhost.
e.g.
if (!document.body.classList.contains('is-pinegrow')) {
// run the code
}
May be location.href? I think this has some url parameters, and in external browser, I think it doesn’t have url params… haven’t checked this yet at my end!
@fakesamgregory and @TechAkayy,
Yeah, @TechAkayy is right. location.href in Pinegrow will have have a pgedit URL parameter, while the browser won’t.
Cheers,
Bob