-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtryjs.min.js
More file actions
1 lines (1 loc) · 3.1 KB
/
tryjs.min.js
File metadata and controls
1 lines (1 loc) · 3.1 KB
1
!function(){var n={id:0,uin:0,reportUrl:"//e.qq.com/phoenix/api.php?mod=monitor&act=front",offline_url:"",offline_auto_url:"",ext:null,level:4,ignore:[],random:1,delay:1e3,submit:null,extension:{}},t=f,e=e||{defineError:r,init:function(e){var o,i,u=["require","define","setTimeout","setInterval"],a=e&&e.fnObject||[];for(o=0,i=a.length;a.length&&o<i&&u.indexOf(a[o])<0;o++)u.push(a[o]);n.id=e.id||n.id,n.reportUrl=e.reportUrl||n.reportUrl,n.random=e.random||1,n.ignore=e.ignore||[],n.uinExtension=e.uinExtension||{},t=e&&e.error||f,r(u,window)},report:function(t){var e={name:t.name||"自定义上报",stack:t.msg||t||""};n.id&&f(e)}};if(Promise&&Promise.prototype.then){var o=Promise.prototype.then;Promise.prototype.then=function(n,t){return o.call(this,c(n),c(t))}}function r(n,t){var e,o,r=Object.prototype.toString.call(n).slice(8,-1).toLowerCase();if("array"===r){for(e=0,o=n.length;e<o;e++)n[e]&&u(n[e],t);return!0}if("string"===r)return i(t[n]);if("object"===r){for(var f in n)"function"==typeof n[f]&&(n[f]=i(n[f]));return n}return"function"===r&&(n.prototype.isReactComponent||n.__proto__.prototype.isReactComponent)?function(n){var t,e=n.prototype;(function(n){var t=!1;try{t=null===n.prototype.constructor.arguments}catch(n){t=!1}for(var e in n.prototype)return!1;return t})(n)&&(n=i(n));for(var o=Object.getOwnPropertyNames(e),r=0,u=o.length;r<u;r++)t=o[r],e[t]=i(e[t]);for(t in e)"function"==typeof e[t]&&(e[t]=i(e[t]));return n}(n):"function"===r?i(n):function(){}}function i(n){return"function"!=typeof n?function(){}:function(){try{return n.apply(this,arguments)}catch(n){throw t(n),n}}}function u(n,t){var e=i(t[n])||function(){};if("function"!=typeof t[n])return function(){};if(["setInterval","setTimeout"].indexOf(n)>=0)t[n]=function(n,t){return e(i(n),t)};else if(["on"].indexOf(n)>=0)t[n]=function(n,t,o){return"function"==typeof o&&o?e(n,t,i(o)):e(n,i(o))};else{if(!(["webpackJsonp"].indexOf(n)>=0))return i(e);t[n]=function(n,t,o){return e(n,t,o)}}}function f(t){setTimeout(function(){a(t.name,t.stack,window.location.href)},n.delay)}function a(t,e,o,r,i){if(!(Math.random()>=n.random)){for(var u=0,f=n.ignore.length;u<f;u++)if(n.ignore[u].test(e))return;var a="";for(var c in n.uinExtension)a+="@"+c+":"+n.uinExtension[c];if(Math.random()<n.random){var l="log_"+(new Date).getTime(),p=window[l]=new Image,d=parseInt((document.cookie.match(/\buin=\D+(\d+)/)||[])[1],10)+a;p.onload=p.onerror=function(){window[l]=null},t=encodeURIComponent(t),e=encodeURIComponent(e),o=encodeURIComponent(o),r=r||0,i=i||0;var s=n.reportUrl.indexOf("?")?"&":"?";p.src=n.reportUrl+s+"id="+n.id+"&level="+n.level+"&type="+t+"&msg="+e+"&from="+o+"&colNum="+i+"&rowNum="+r+"&uin="+d,p=null}}}function c(n){return"function"!=typeof n?null:function(){try{return n.apply(this,arguments)}catch(n){throw t(n),n}}}function l(t,e,o,r,i){e=e||window.location.href,t.type?setTimeout(function(){a("Resource load "+t.type,"Resource load "+t.type+" @"+t.target.tagName+": "+t.target.outerHTML,e,o,r)},n.delay):setTimeout(function(){a(i?JSON.stringify(i):t,t,e,o,r)},n.delay)}window.attachEvent?window.attachEvent("error",l,!0):window.addEventListener("error",l,!0),window.Tryjs=e}();