0

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?

Uchitha
  • 998
  • 8
  • 24
  • use what has been done here: http://stackoverflow.com/questions/1926394/get-browser-version-of-ie-using-javascript and add some logic to handle glimpse – chiliNUT Aug 06 '13 at 03:50
  • 1
    Thanks for the link. However I'm reluctant to introduce code changes to the business app to manage a tool like Glimpse. I believe that's one of the goals of Glimpse developers as well. Having said that this can be added to Glimpse (if it's not already there). – Uchitha Aug 06 '13 at 06:26
  • Can you share your run time policy with us? – nikmd23 Aug 06 '13 at 12:02
  • 1
    Are you placing the Glimpse script tags manually in your layout using `Html.GlimpseClient()`? – nikmd23 Aug 06 '13 at 12:13
  • That's exactly the reason. One of the master views had a reference to the Glimpse Client. I didn't notice it due to the convoluted nature of the source. Thank you very much! Can you put it down as the answer so that I can mark it? – Uchitha Aug 07 '13 at 02:14

1 Answers1

0

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.

Uchitha
  • 998
  • 8
  • 24