From ec0d6959a95c338f583f277d748123aef1e2a5e5 Mon Sep 17 00:00:00 2001 From: Shannon Date: Sun, 8 Jun 2014 17:15:52 +0200 Subject: [PATCH] mini profiler in back office now enabled with query string --- .../umbraco/Views/Default.cshtml | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml index 3aa9b2f902..025f8433e5 100644 --- a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml +++ b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml @@ -1,4 +1,5 @@ -@using System.Web.Mvc.Html +@using System.Net.Http +@using System.Web.Mvc.Html @using Umbraco.Core @using ClientDependency.Core @using ClientDependency.Core.Mvc @@ -63,7 +64,23 @@ - @Html.RenderProfiler() + @{ + var isDebug = false; + if (Request.RawUrl.IndexOf('?') >= 0) + { + var parsed = HttpUtility.ParseQueryString(Request.RawUrl.Split('?')[1]); + var attempt = parsed["umbDebug"].TryConvertTo(); + if (attempt && attempt.Result) + { + isDebug = true; + } + } + + } + @if (isDebug) + { + @Html.RenderProfiler() + }