html5 - Whats this long script in page source. What it is used for? -


the script below embedded in head section of html page below <meta> tags. can explain purpose of putting such long script in head section without content?

<script type="text/javascript">     (window.nreum||(nreum={})).loader_config={xpid:"vg8hu1dugwijvfzabwk="};window.nreum||(nreum={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o?o:e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({qjf3ax:[function(t,e){function n(t){function e(e,n,a){t&&t(e,n,a),a||(a={});for(var c=s(e),f=c.length,u=i(a,o,r),d=0;f>d;d++)c[d].apply(u,n);return u}function a(t,e){f[t]=s(t).concat(e)}function s(t){return f[t]||[]}function c(){return n(e)}var f={};return{on:a,emit:e,create:c,listeners:s,_events:f}}function r(){return{}}var o="nr@context",i=t("gos");e.exports=n()},{gos:"7esdfh"}],ee:[function(t,e){e.exports=t("qjf3ax")},{}],3:[function(t){function e(t){try{i.console&&console.log(t)}catch(e){}}var n,r=t("ee"),o=t(1),i={};try{n=localstorage.getitem("__nr_flags").split(","),console&&"function"==typeof console.log&&(i.console=!0,-1!==n.indexof("dev")&&(i.dev=!0),-1!==n.indexof("nr_dev")&&(i.nrdev=!0))}catch(a){}i.nrdev&&r.on("internal-error",function(t){e(t.stack)}),i.dev&&r.on("fn-err",function(t,n,r){e(r.stack)}),i.dev&&(e("nr agent in development mode"),e("flags: "+o(i,function(t){return t}).join(", ")))},{1:23,ee:"qjf3ax"}],4:[function(t){function e(t,e,n,i,s){try{c?c-=1:r("err",[s||new uncaughtexception(t,e,n)])}catch(f){try{r("ierr",[f,(new date).gettime(),!0])}catch(u){}}return"function"==typeof a?a.apply(this,o(arguments)):!1}function uncaughtexception(t,e,n){this.message=t||"uncaught error no additional information",this.sourceurl=e,this.line=n}function n(t){r("err",[t,(new date).gettime()])}var r=t("handle"),o=t(6),i=t("ee"),a=window.onerror,s=!1,c=0;t("loader").features.err=!0,t(5),window.onerror=e;try{throw new error}catch(f){"stack"in f&&(t(1),t(2),"addeventlistener"in window&&t(3),window.xmlhttprequest&&xmlhttprequest.prototype&&xmlhttprequest.prototype.addeventlistener&&window.xmlhttprequest&&xmlhttprequest.prototype&&xmlhttprequest.prototype.addeventlistener&&!/crios/.test(navigator.useragent)&&t(4),s=!0)}i.on("fn-start",function(){s&&(c+=1)}),i.on("fn-err",function(t,e,r){s&&(this.thrown=!0,n(r))}),i.on("fn-end",function(){s&&!this.thrown&&c>0&&(c-=1)}),i.on("internal-error",function(t){r("ierr",[t,(new date).gettime(),!0])})},{1:10,2:9,3:7,4:11,5:3,6:24,ee:"qjf3ax",handle:"d5dulp",loader:"g9z0bl"}],5:[function(t){t("loader").features.ins=!0},{loader:"g9z0bl"}],6:[function(t){function e(){}if(window.performance&&window.performance.timing&&window.performance.getentriesbytype){var n=t("ee"),r=t("handle"),o=t(1),i=t(2);t("loader").features.stn=!0,t(3),n.on("fn-start",function(t){var e=t[0];e instanceof event&&(this.bststart=date.now())}),n.on("fn-end",function(t,e){var n=t[0];n instanceof event&&r("bst",[n,e,this.bststart,date.now()])}),o.on("fn-start",function(t,e,n){this.bststart=date.now(),this.bsttype=n}),o.on("fn-end",function(t,e){r("bsttimer",[e,this.bststart,date.now(),this.bsttype])}),i.on("fn-start",function(){this.bststart=date.now()}),i.on("fn-end",function(t,e){r("bsttimer",[e,this.bststart,date.now(),"requestanimationframe"])}),n.on("pushstate-start",function(){this.time=date.now(),this.startpath=location.pathname+location.hash}),n.on("pushstate-end",function(){r("bsthist",[location.pathname+location.hash,this.startpath,this.time])}),"addeventlistener"in window.performance&&(window.performance.addeventlistener("webkitresourcetimingbufferfull",function(){r("bstresource",[window.performance.getentriesbytype("resource")]),window.performance.webkitclearresourcetimings()},!1),window.performance.addeventlistener("resourcetimingbufferfull",function(){r("bstresource",[window.performance.getentriesbytype("resource")]),window.performance.clearresourcetimings()},!1)),document.addeventlistener("scroll",e,!1),document.addeventlistener("keypress",e,!1),document.addeventlistener("click",e,!1)}},{1:10,2:9,3:8,ee:"qjf3ax",handle:"d5dulp",loader:"g9z0bl"}],7:[function(t,e){function n(t){i.inplace(t,["addeventlistener","removeeventlistener"],"-",r)}function r(t){return t[1]}var o=(t(1),t("ee").create()),i=t(2)(o),a=t("gos");if(e.exports=o,n(window),"getprototypeof"in object){for(var s=document;s&&!s.hasownproperty("addeventlistener");)s=object.getprototypeof(s);s&&n(s);for(var c=xmlhttprequest.prototype;c&&!c.hasownproperty("addeventlistener");)c=object.getprototypeof(c);c&&n(c)}else xmlhttprequest.prototype.hasownproperty("addeventlistener")&&n(xmlhttprequest.prototype);o.on("addeventlistener-start",function(t){if(t[1]){var e=t[1];"function"==typeof e?this.wrapped=t[1]=a(e,"nr@wrapped",function(){return i(e,"fn-",null,e.name||"anonymous")}):"function"==typeof e.handleevent&&i.inplace(e,["handleevent"],"fn-")}}),o.on("removeeventlistener-start",function(t){var e=this.wrapped;e&&(t[1]=e)})},{1:24,2:25,ee:"qjf3ax",gos:"7esdfh"}],8:[function(t,e){var n=(t(2),t("ee").create()),r=t(1)(n);e.exports=n,r.inplace(window.history,["pushstate"],"-")},{1:25,2:24,ee:"qjf3ax"}],9:[function(t,e){var n=(t(2),t("ee").create()),r=t(1)(n);e.exports=n,r.inplace(window,["requestanimationframe","mozrequestanimationframe","webkitrequestanimationframe","msrequestanimationframe"],"raf-"),n.on("raf-start",function(t){t[0]=r(t[0],"fn-")})},{1:25,2:24,ee:"qjf3ax"}],10:[function(t,e){function n(t,e,n){t[0]=o(t[0],"fn-",null,n)}var r=(t(2),t("ee").create()),o=t(1)(r);e.exports=r,o.inplace(window,["settimeout","setinterval","setimmediate"],"settimer-"),r.on("settimer-start",n)},{1:25,2:24,ee:"qjf3ax"}],11:[function(t,e){function n(){f.inplace(this,p,"fn-")}function r(t,e){f.inplace(e,["onreadystatechange"],"fn-")}function o(t,e){return e}function i(t,e){for(var n in t)e[n]=t[n];return e}var a=t("ee").create(),s=t(1),c=t(2),f=c(a),u=c(s),d=window.xmlhttprequest,p=["onload","onerror","onabort","onloadstart","onloadend","onprogress","ontimeout"];e.exports=a,window.xmlhttprequest=function(t){var e=new d(t);try{a.emit("new-xhr",[],e),u.inplace(e,["addeventlistener","removeeventlistener"],"-",o),e.addeventlistener("readystatechange",n,!1)}catch(r){try{a.emit("internal-error",[r])}catch(i){}}return e},i(d,xmlhttprequest),xmlhttprequest.prototype=d.prototype,f.inplace(xmlhttprequest.prototype,["open","send"],"-xhr-",o),a.on("send-xhr-start",r),a.on("open-xhr-start",r)},{1:7,2:25,ee:"qjf3ax"}],12:[function(t){function e(t){var e=this.params,r=this.metrics;if(!this.ended){this.ended=!0;for(var i=0;c>i;i++)t.removeeventlistener(s[i],this.listener,!1);if(!e.aborted){if(r.duration=(new date).gettime()-this.starttime,4===t.readystate){e.status=t.status;var a=t.responsetype,f="arraybuffer"===a||"blob"===a||"json"===a?t.response:t.responsetext,u=n(f);if(u&&(r.rxsize=u),this.sameorigin){var d=t.getresponseheader("x-newrelic-app-data");d&&(e.cat=d.split(", ").pop())}}else e.status=0;r.cbtime=this.cbtime,o("xhr",[e,r,this.starttime])}}}function n(t){if("string"==typeof t&&t.length)return t.length;if("object"!=typeof t)return void 0;if("undefined"!=typeof arraybuffer&&t instanceof arraybuffer&&t.bytelength)return t.bytelength;if("undefined"!=typeof blob&&t instanceof blob&&t.size)return t.size;if("undefined"!=typeof formdata&&t instanceof formdata)return void 0;try{return json.stringify(t).length}catch(e){return void 0}}function r(t,e){var n=i(e),r=t.params;r.host=n.hostname+":"+n.port,r.pathname=n.pathname,t.sameorigin=n.sameorigin}if(window.xmlhttprequest&&xmlhttprequest.prototype&&xmlhttprequest.prototype.addeventlistener&&!/crios/.test(navigator.useragent)){t("loader").features.xhr=!0;var o=t("handle"),i=t(2),a=t("ee"),s=["load","error","abort","timeout"],c=s.length,f=t(1);t(4),t(3),a.on("new-xhr",function(){this.totalcbs=0,this.called=0,this.cbtime=0,this.end=e,this.ended=!1,this.xhrguids={}}),a.on("open-xhr-start",function(t){this.params={method:t[0]},r(this,t[1]),this.metrics={}}),a.on("open-xhr-end",function(t,e){"loader_config"in nreum&&"xpid"in nreum.loader_config&&this.sameorigin&&e.setrequestheader("x-newrelic-id",nreum.loader_config.xpid)}),a.on("send-xhr-start",function(t,e){var r=this.metrics,o=t[0],i=this;if(r&&o){var f=n(o);f&&(r.txsize=f)}this.starttime=(new date).gettime(),this.listener=function(t){try{"abort"===t.type&&(i.params.aborted=!0),("load"!==t.type||i.called===i.totalcbs&&(i.onloadcalled||"function"!=typeof e.onload))&&i.end(e)}catch(n){try{a.emit("internal-error",[n])}catch(r){}}};for(var u=0;c>u;u++)e.addeventlistener(s[u],this.listener,!1)}),a.on("xhr-cb-time",function(t,e,n){this.cbtime+=t,e?this.onloadcalled=!0:this.called+=1,this.called!==this.totalcbs||!this.onloadcalled&&"function"==typeof n.onload||this.end(n)}),a.on("xhr-load-added",function(t,e){var n=""+f(t)+!!e;this.xhrguids&&!this.xhrguids[n]&&(this.xhrguids[n]=!0,this.totalcbs+=1)}),a.on("xhr-load-removed",function(t,e){var n=""+f(t)+!!e;this.xhrguids&&this.xhrguids[n]&&(delete this.xhrguids[n],this.totalcbs-=1)}),a.on("addeventlistener-end",function(t,e){e instanceof xmlhttprequest&&"load"===t[0]&&a.emit("xhr-load-added",[t[1],t[2]],e)}),a.on("removeeventlistener-end",function(t,e){e instanceof xmlhttprequest&&"load"===t[0]&&a.emit("xhr-load-removed",[t[1],t[2]],e)}),a.on("fn-start",function(t,e,n){e instanceof xmlhttprequest&&("onload"===n&&(this.onload=!0),("load"===(t[0]&&t[0].type)||this.onload)&&(this.xhrcbstart=(new date).gettime()))}),a.on("fn-end",function(t,e){this.xhrcbstart&&a.emit("xhr-cb-time",[(new date).gettime()-this.xhrcbstart,this.onload,e],e)})}},{1:"xl7hbi",2:13,3:11,4:7,ee:"qjf3ax",handle:"d5dulp",loader:"g9z0bl"}],13:[function(t,e){e.exports=function(t){var e=document.createelement("a"),n=window.location,r={};e.href=t,r.port=e.port;var o=e.href.split("://");return!r.port&&o[1]&&(r.port=o[1].split("/")[0].split("@").pop().split(":")[1]),r.port&&"0"!==r.port||(r.port="https"===o[0]?"443":"80"),r.hostname=e.hostname||n.hostname,r.pathname=e.pathname,r.protocol=o[0],"/"!==r.pathname.charat(0)&&(r.pathname="/"+r.pathname),r.sameorigin=!e.hostname||e.hostname===document.domain&&e.port===n.port&&e.protocol===n.protocol,r}},{}],14:[function(t,e){function n(t){return function(){r(t,[(new date).gettime()].concat(i(arguments)))}}var r=t("handle"),o=t(1),i=t(2);"undefined"==typeof window.newrelic&&(newrelic=window.nreum);var a=["setpageviewname","addpageaction","setcustomattribute","finished","addtotrace","inlinehit","noticeerror"];o(a,function(t,e){window.nreum[e]=n("api-"+e)}),e.exports=window.nreum},{1:23,2:24,handle:"d5dulp"}],"7esdfh":[function(t,e){function n(t,e,n){if(r.call(t,e))return t[e];var o=n();if(object.defineproperty&&object.keys)try{return object.defineproperty(t,e,{value:o,writable:!0,enumerable:!1}),o}catch(i){}return t[e]=o,o}var r=object.prototype.hasownproperty;e.exports=n},{}],gos:[function(t,e){e.exports=t("7esdfh")},{}],handle:[function(t,e){e.exports=t("d5dulp")},{}],d5dulp:[function(t,e){function n(t,e,n){return r.listeners(t).length?r.emit(t,e,n):(o[t]||(o[t]=[]),void o[t].push(e))}var r=t("ee").create(),o={};e.exports=n,n.ee=r,r.q=o},{ee:"qjf3ax"}],id:[function(t,e){e.exports=t("xl7hbi")},{}],xl7hbi:[function(t,e){function n(t){var e=typeof t;return!t||"object"!==e&&"function"!==e?-1:t===window?0:i(t,o,function(){return r++})}var r=1,o="nr@id",i=t("gos");e.exports=n},{gos:"7esdfh"}],g9z0bl:[function(t,e){function n(){var t=p.info=nreum.info,e=f.getelementsbytagname("script")[0];if(t&&t.licensekey&&t.applicationid&&e){s(d,function(e,n){e in t||(t[e]=n)});var n="https"===u.split(":")[0]||t.sslforhttp;p.proto=n?"https://":"http://",a("mark",["onload",i()]);var r=f.createelement("script");r.src=p.proto+t.agent,e.parentnode.insertbefore(r,e)}}function r(){"complete"===f.readystate&&o()}function o(){a("mark",["domcontent",i()])}function i(){return(new date).gettime()}var a=t("handle"),s=t(1),c=(t(2),window),f=c.document,u=(""+location).split("?")[0],d={beacon:"bam.nr-data.net",errorbeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-632.min.js"},p=e.exports={offset:i(),origin:u,features:{}};f.addeventlistener?(f.addeventlistener("domcontentloaded",o,!1),c.addeventlistener("load",n,!1)):(f.attachevent("onreadystatechange",r),c.attachevent("onload",n)),a("mark",["firstbyte",i()])},{1:23,2:14,handle:"d5dulp"}],loader:[function(t,e){e.exports=t("g9z0bl")},{}],23:[function(t,e){function n(t,e){var n=[],o="",i=0;for(o in t)r.call(t,o)&&(n[i]=e(o,t[o]),i+=1);return n}var r=object.prototype.hasownproperty;e.exports=n},{}],24:[function(t,e){function n(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,o=n-e||0,i=array(0>o?0:o);++r<o;)i[r]=t[e+r];return i}e.exports=n},{}],25:[function(t,e){function n(t){return!(t&&"function"==typeof t&&t.apply&&!t[i])}var r=t("ee"),o=t(1),i="nr@wrapper",a=object.prototype.hasownproperty;e.exports=function(t){function e(t,e,r,a){function nrwrapper(){var n,i,s,f;try{i=this,n=o(arguments),s=r&&r(n,i)||{}}catch(d){u([d,"",[n,i,a],s])}c(e+"start",[n,i,a],s);try{return f=t.apply(i,n)}catch(p){throw c(e+"err",[n,i,p],s),p}finally{c(e+"end",[n,i,f],s)}}return n(t)?t:(e||(e=""),nrwrapper[i]=!0,f(t,nrwrapper),nrwrapper)}function s(t,r,o,i){o||(o="");var a,s,c,f="-"===o.charat(0);for(c=0;c<r.length;c++)s=r[c],a=t[s],n(a)||(t[s]=e(a,f?s+o:o,i,s))}function c(e,n,r){try{t.emit(e,n,r)}catch(o){u([o,e,n,r])}}function f(t,e){if(object.defineproperty&&object.keys)try{var n=object.keys(t);return n.foreach(function(n){object.defineproperty(e,n,{get:function(){return t[n]},set:function(e){return t[n]=e,e}})}),e}catch(r){u([r])}for(var o in t)a.call(t,o)&&(e[o]=t[o]);return e}function u(e){try{t.emit("internal-error",e)}catch(n){}}return t||(t=r),e.inplace=s,e.flag=i,e}},{1:24,ee:"qjf3ax"}]},{},["g9z0bl",4,12,6,5]); </script> <script type="text/javascript">     if (top.location != self.location)     top.location = self.location; </script> 

this referred frame busting code. breaks framed document out top level.

top.location != self.location when current document not @ top level in window (e.g. it's in frame or iframe).

and, top.location = self.location; sets current url top level of window - breaking out of frame , moving top level of window.

this done sites want prevent being framed. can read more detailed description here.


modern browsers support newer means of preventing framing x-frame-options header. see description here.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -