Hi Martin,
It's IIS 8, .NET 4.0, SQL Server 2012, Windows 8 server
Running Kentico 8.1.16, fresh install. I haven't tested the Corporate site, but I don't think theres any differences. Because in the Preview window, there are default javascripts loaded by Kentico.
I understand that the system is probably leveraging these scripts to make it work properly within the admin. But in my opinion, when you click the Preview mode, the user should be presented with a true representation of what they have built. i.e. Exactly what they will see when they go to live. But this isn't the case because all these administration site scripts are loaded.
So what I ended up doing is, in the MasterPage, I created a cms.js file that unloads the kentico admin scripts and used it with the following to get around it.
<script runat="server">
protected void Page_Load(Object sender, EventArgs e) {
if (CMS.PortalEngine.PortalContext.ViewMode== CMS.PortalEngine.ViewModeEnum.LiveSite)
{
string jsBlock= String.Format("<script src='vendor.js'></script" + ">");
if (!Page.ClientScript.IsStartupScriptRegistered("myJsInclude"))
Page.ClientScript.RegisterStartupScript(typeof(string), "myJsInclude", jsBlock, false);
} else {
CMS.Helpers.ScriptHelper.RegisterClientScriptInclude(this, this.GetType(), "cms.js", CMS.Helpers.URLHelper.ResolveUrl("~/CMSScripts/Custom/Crown/cms.js"), false);
}
</script>