-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbabel.mini.js
More file actions
executable file
·4 lines (4 loc) · 1.56 KB
/
babel.mini.js
File metadata and controls
executable file
·4 lines (4 loc) · 1.56 KB
1
2
3
4
'use strict';window.parent&&("complete"===document.readyState||"loaded"===document.readyState?h():document.addEventListener("DOMContentLoaded",h));function h(){window.addEventListener("popstate",function(){m("location",window.history.state)});(new window.MutationObserver(function(){m("title",document.title)})).observe(document.querySelector("head > title"),{subtree:!0,characterData:!0,childList:!0});m("location",window.location.href);m("title",document.title);n();p()}
function m(d,e){window.parent.postMessage({type:d,value:e},"*")}function n(){for(var d=m,e=document.head.getElementsByTagName("link"),b=[],f=0,l=e.length;f<l;f++){var a=e[f];if(a.hasAttribute("rel")){var c=a.getAttribute("rel");"apple-touch-icon"!==c&&"icon"!==c||b.push({a:a.outerHTML,href:"http://localhost:63342/babel/test/favicon.png"})}}0===b.length&&(b=[{a:'<link rel="icon" type="image/x-icon" href="favicon.ico">',href:window.location.origin+"/favicon.ico"}]);d("favicons",b)}
function p(){function d(a){a.setAttribute("target","_top")}for(var e=document.links,b=window.location.hostname.split("."),b=2<b.length&&4>b[b.length-2].length?b.slice(-3):b.slice(-2),f=0,l=e.length;f<l;f++){var a=e[f];if("bit"===a.hostname.slice(-3))a.hostname=a.hostname.slice(0,-3)+"spx.is",a.target||d(a);else if(!a.target&&("//"===a.href.slice(0,1)||"http"===a.href.slice(0,4))){var c=!0;if(a.hasAttribute("rel")){var g=a.getAttribute("rel");if(-1<g.indexOf("external")||-1<g.indexOf("nofollow"))d(a),
c=!1}if(c){for(var c=a.hostname.split(".").slice(-b.length),g=c.length===b.length,k=0;g&&k<c.length;)g=c[k]===b[k],k++;g||d(a)}}}};