How to disable glimpse update check request?

I noticed that a glimpse checks if there are any updates on clientide through https://getglimpse.com/Api/Version/Check?Glimpse.Ado=1.7.3&Glimpse.AspNet=1.9.2&Glimpse=1.8.6&Glimpse.EF6= 1.6.5 & Glimpse.Mvc5 = 1.5.3 & stamp = 1450129430335 & callback = glimpse.versionCheck.result .

http://prntscr.com/9edgdy

Also, the request cannot be completed because the certificate of the link is invalid.

How to disable it?

+5
source share
2 answers

Changing the configuration with a different URL or loopback address for Url will not stop Glimpse to execute the request version check request. I found that version checking starts with the client function versionCheck .

Here is the fix I figured out how to disable the versionCheck function of a versionCheck object:

 document.addEventListener("DOMContentLoaded", function () { // A wierd fix to wait until glimpse is initialized. setTimeout(turnoffGlimpseVersionCheck, 100); }); function turnoffGlimpseVersionCheck() { if (typeof glimpse == 'undefined') { console.log("glimpse not found!") } else { console.log(glimpse.settings); glimpse.versionCheck = function () { }; console.log("glimpse updates turned off!!") } } 

It may not sound very good, but it will just be a trick. C>

Update

Here's the updated and better version:

 <script> document.addEventListener("DOMContentLoaded", function () { var scripts = document.getElementsByTagName("script"); var isGlimpseLoaded = false; for (var i = 0; i < scripts.length; ++i) { var src = scripts[i].getAttribute('src'); if (src == null) continue; if (src.indexOf('Glimpse.axd') > -1) { turnoffGlimpseVersionCheck(); break; } } }); function turnoffGlimpseVersionCheck() { glimpse.versionCheck = function () { }; console.log('glimpse version check disabled!!') } </script> 
+1
source

Set <add key="GlimpseVersionCheckAPIDomain" value="240.0.0.1" /> in the <appSettings> your Web.config .

This will reconfigure any call that would otherwise go to getglimpse.com in a black hole . I tested this and confirmed zero attempts at the telephone house, and now the pages load much faster.

The corresponding code is in: Glimpse.Core / Resource / VersionCheckResource.cs

 var domain = ConfigurationManager.AppSettings["GlimpseVersionCheckAPIDomain"]; if (string.IsNullOrEmpty(domain)) { domain = "getGlimpse.com"; } return new CacheControlDecorator(OneDay, CacheSetting.Public, new RedirectResourceResult(@"//" + domain + "/Api/Version/Check{?packages*}{&stamp}{&callback}", data)); 
+1
source

Source: https://habr.com/ru/post/1238299/


All Articles