title: Detect Custom Protocol handler in chrome 86
body: <p>I have implemented a solution according to <a href="https://gist.github.com/aaronk6/d801d750f14ac31845e8" rel="nofollow noreferrer">https://gist.github.com/aaronk6/d801d750f14ac31845e8</a>  and it worked fine till chrome 85 .With latest chrome Update Onblur not detecting open protocol handler popup. Is there a way to identify Custom protocol registered in windows using Chrome 86 new version .The code i have implemented mentioned below and it's working fine for Firefox</p>
  <pre><code>function LinkClicked() {
          launchUri($(this).attr(&quot;href&quot;), function () {
              // SUCCESS APPLICATION INSTALLED
          }, function () {
              // PROTOCOL NOT REGISTERD IN REGISTRY
              setTimeout(showAppInstallWarningMessage, 4000);
          }, function () {
              // STATUS CANNOT IDENTIFY
              setTimeout(showAppInstallWarningMessage, 4000);
          });
      }
  
  
  
  
  
  function launchUri(uri, successCallback, noHandlerCallback, unknownCallback) {
      var res, parent, popup, iframe, timer, timeout, blurHandler, timeoutHandler, browser;
  
      function callback(cb) {
          if (typeof cb === 'function') cb();
      }
  
      function createHiddenIframe(parent) {
          var iframe;
          if (!parent) parent = document.body;
          iframe = document.createElement('iframe');
          iframe.style.display = 'none';
          parent.appendChild(iframe);
          return iframe;
      }
  
      function removeHiddenIframe(parent) {
          if (!iframe) return;
          if (!parent) parent = document.body;
          parent.removeChild(iframe);
          iframe = null;
      }
  
      browser = { isChrome: false, isFirefox: false, isIE: false };
  
      if (window.chrome &amp;&amp; !navigator.userAgent.match(/Opera|OPR\//)) {
          browser.isChrome = true;
      } else if (typeof InstallTrigger !== 'undefined') {
          browser.isFirefox = true;
      } else if ('ActiveXObject' in window) {
          browser.isIE = true;
      }
  
      // EVALUATE msLaunchUri for IE 10+ browser in  Windows 8+
      if (navigator.msLaunchUri) {
          navigator.msLaunchUri(uri, successCallback, noHandlerCallback);
      }
      // Evaluating Blur-hack Chrome and FireFox
      else if (browser.isChrome || browser.isFirefox) {
          blurHandler = function () {
              window.clearTimeout(timeout);
              window.removeEventListener('blur', blurHandler);
              callback(successCallback);
          };
          timeoutHandler = function () {
              window.removeEventListener('blur', blurHandler);
              callback(noHandlerCallback);
          };
          window.addEventListener('blur', blurHandler);
          timeout = window.setTimeout(timeoutHandler, 500);
          window.location.href = uri;
      }
      else if (browser.isIE) {
          popup = window.open('', 'launcher', 'width=0,height=0');
          popup.location.href = uri;
          try {
              popup.location.href = 'about:blank';
              callback(successCallback);
              timer = window.setInterval(function () {
                  popup.close();
                  if (popup.closed) window.clearInterval(timer);
              }, 500);
          } catch (e) {
              popup = window.open('about:blank', 'launcher');
              popup.close();
              callback(noHandlerCallback);
          }
      }
      else {
          iframe = createHiddenIframe();
          iframe.contentWindow.location.href = uri;
          window.setTimeout(function () {
              removeHiddenIframe(parent);
              callback(unknownCallback);
          }, 500);
      }
  }
  </code></pre>