UNPKG

848 BJavaScriptView Raw
1(function(){var e,t,r;return t=__opts__,e=function(n){var o;return null==n&&(n=!1),o=new WebSocket("ws://"+document.domain+":"+t.proxyPort+"/"),o.onmessage=function(e){return"refresh"===e.data?r():location.reload()},o.onclose=function(){return e(!0)},o.onopen=function(){return n&&t.reloadAfterReconnect?location.reload():void 0}},r=function(){var e,t,r,n,o,u;for(o=document.querySelectorAll('link[rel="stylesheet"]'),u=[],r=0,n=o.length;n>r;r++)t=o[r],null==t.getAttribute("data-href-origin")&&t.setAttribute("data-href-origin",t.getAttribute("href")),e=t.cloneNode(!0),e.onload=function(){return t.parentNode.removeChild(t)},e.onerror=function(){return t.parentNode.removeChild(e)},e.setAttribute("href",t.getAttribute("data-href-origin")+"?"+Date.now()),u.push(t.parentNode.appendChild(e));return u},e()})(window.WebSocket||window.MozWebSocket);
\No newline at end of file