Start MiniProfiler UI minimized?

227 Views Asked by At

I've added MiniProfiler to an ASP.NET Core SPA app, and when first loading my app there are a lot of requests made so MiniProfiler UI covers some important parts of my app (and there's not really any good location to place it with that many traces showing).

I'd like start MiniProfiler minimized, so that I can expand it to check the profile when something feels slower than expected (I don't want to refresh the page, because the speed might be fine the next time)

How can I start the UI in minimzed mode, so I can expand it on demand?

1

There are 1 best solutions below

0
Wilka On

If the goal is just to have MiniProfiler out of the way by default, then instead of starting it minimized you can start it hidden.

Inside your cshtml file, you can set start-hidden to true, e.g.

<mini-profiler show-controls="true" start-hidden="true" />

Then when running your app, you can toggle the visibility by pressing Alt+P.

It'll save the visibility state in local storage, so it'll continue to be visible every time you run the app until you press Alt+P again (or clear the local storage)