UNPKG

@nohost/server

Version:

Multi-user & multi-env web debugging proxy based on whistle

39 lines (35 loc) 1.13 kB
``` whistle.nohost/inject.html <script> (function() { if (typeof window === 'undefined' || !window || window.self !== window.top || window.__whistle_nohost_from_imweb_is_inited__) { return; } window.__whistle_nohost_from_imweb_is_inited__ = true; var head = document.head || document.getElementsByTagName('head')[0] || document.documentElement; var script = document.createElement('script'); var prefixPath = window.__WHISTLE_PATH_PREFIX__; if (/^\/[\w./-]+$/.test(prefixPath) && prefixPath.length <= 128) { var len = prefixPath.length - 1; if (prefixPath[len] === '/') { prefixPath = prefixPath.substring(0, len); } } else { prefixPath = ''; } script.defer = true; script.charset = 'utf8'; script.src = prefixPath + '/.whistle-path.5b6af7b9884e1165/whistle.nohost/button.js'; if (head.firstChild) { head.insertBefore(script, head.firstChild); } else { head.appendChild(script); } })(); </script> ``` ``` whistle.nohost/none.html <script> window.__whistle_nohost_from_imweb_is_inited__ = true; </script> ```