Domanda

I'm integrating Glimpse (1.5.0) for a legacy WebApp (Running on MVC3) which has different kinds of browser audience. I want to persist Glimpse results for older browsers (read IE7, 8) and wrote a new Runtime policy as instructed in https://github.com/Glimpse/Glimpse/issues/272.

However I still see that glimpse client side scripts are being injected on to the page causing errors on IE ('glimpse' is undefined). If I change the runtime policy to return 'RuntimePolicy.Off' instead of 'RuntimePolicy.PersistResults', these client side scripts are not sent.

Here are the included script tags that I wasn't expecting.

<script type='text/javascript' src='/xxx/Glimpse.axd?n=glimpse_client&amp;hash=6920ad76'></script>     
<script type='text/javascript' src='/xxx/Glimpse.axd?n=glimpse_metadata&amp;hash=6920ad76&amp;callback=glimpse.data.initMetadata'></script>
<script type='text/javascript' src='/xxx/Glimpse.axd?n=glimpse_request&amp;requestId=4ca1532d-1192-4bd9-956d-98e046ea6e15&amp;hash=6920ad76&amp;callback=glimpse.data.initData'></script>

I think I'm missing something else to completely prevent glimpse client side scripts being sent to older browsers. Can anyone please help?

È stato utile?

Soluzione

I will note down Nicks comment above as it ended up being the answer.

In order to control Glimpse behaviour for a particular browser the, the option is to write your own custom runtime policy as mentioned in https://github.com/Glimpse/Glimpse/issues/272.

In my case, one of the master files was still having the call Html.GlimpseClient() which obviously injected the client regardless of what happens with the runtime policy.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top