-
Notifications
You must be signed in to change notification settings - Fork 1
/
_values.txt
1 lines (1 loc) · 2.74 KB
/
_values.txt
1
{"whistle.devtool/sdk.js":"<script type=text/javascript>!function(){var e={429:function(){var e,t;let n=window;function o(e){let t=document.body;for(let n=0;n<e.length;n++){let o=e[n];if(!t||void 0===t.childNodes[o])return null;t=t.childNodes[o]}return t}let i=!1,r=new WebSocket(\"wss://local.whistlejs.com/whistle.devtool?from=sdk\");r.onopen=()=>{console.log(\"Connected to server\"),r.send(JSON.stringify({type:\"connected\",content:{url:location.href,ua:navigator.userAgent}}))},r.onclose=()=>{console.log(\"Disconnected from server\")},r.onmessage=e=>{var t;let{data:n}=e;(t=n,new Promise((e,n)=>{let o=new FileReader;o.onload=()=>{e(o.result)},o.onerror=e=>{n(e)},o.readAsText(t)})).then(e=>{if(\"eval\"===(e=JSON.parse(e)).type){let t=Function(\"return \"+e.content);r.send(JSON.stringify({type:\"eval\",content:t()}))}else if(\"html\"===e.type)r.send(JSON.stringify({type:\"html\",tag:\"html\",content:document.documentElement.outerHTML})),r.send(JSON.stringify({type:\"view-wh\",content:{width:window.innerWidth,height:window.innerHeight}}));else if(\"connected\"===e.type)r.send(JSON.stringify({type:\"connected\",content:{url:location.href,ua:navigator.userAgent}}));else if(\"mutation\"===e.type){let t=e.content;i=!0,\"attributes\"===t.type?o(t.path).setAttribute(t.attributeName,t.newValue):\"characterData\"===t.type?o(t.path).nodeValue=t.newValue:(\"removedNode\"===t.type||\"addedNode\"===t.type)&&(o(t.path).innerHTML=t.html),setTimeout(()=>{i=!1},3e3)}})},!function(e){if(!n.__whistleRewriteConsole)[\"log\",\"warn\",\"error\",\"info\"].forEach(function(t){let n=window.console[t];window.console[t]=function(){e&&e(t,[].slice.call(arguments)),n.apply(window.console,[].slice.call(arguments))}}),n.__whistleRewriteConsole=!0}((e,t)=>{r.readyState===r.OPEN&&r.send(JSON.stringify({type:\"console\",content:[{method:e,args:t}]}))});let l=\"\";let s=(e=()=>{r.send(JSON.stringify({type:\"html\",tag:\"body\",content:l})),r.send(JSON.stringify({type:\"view-wh\",content:{width:window.innerWidth,height:window.innerHeight}}))},function(){var n=this,o=arguments;clearTimeout(t),t=setTimeout(function(){e.apply(n,o)},300)}),d=new MutationObserver((e,t)=>{!i&&(l=document.documentElement.outerHTML,s())});document.addEventListener(\"DOMContentLoaded\",()=>{r.send(JSON.stringify({type:\"view-wh\",content:{width:window.innerWidth,height:window.innerHeight}})),r.send(JSON.stringify({type:\"html\",tag:\"html\",content:document.documentElement.outerHTML})),setTimeout(()=>{d.observe(document.body,{childList:!0,attributes:!0,subtree:!0})})}),window.addEventListener(\"scroll\",()=>{r.send(JSON.stringify({type:\"scrollY\",content:window.scrollY}))})}},t={};!function n(o){var i=t[o];if(void 0!==i)return i.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}(\"429\")}();</script>"}