Initialisation depot
This commit is contained in:
commit
c3176e8d79
818 files changed
+52573
No files matched your search
@@ -0,0 +1 @@
|
||||
var baxiaCommon=function(){"use strict";var win=window,BAXIA_KEY="__baxia__",getStore=function(e,t){var r=win[BAXIA_KEY]||{};return e?r[e]||t:r},setStore=function(e,t){win[BAXIA_KEY]=win[BAXIA_KEY]||{},win[BAXIA_KEY][e]=t},includes=function(e,t){return!!e&&e.indexOf(t)>-1},isObjectString=function(e){var t=!0;try{JSON.parse(e)}catch(r){t=!1}return t},isEmptyObject=function(e){if(!e)return!0;for(var t in e)return!1;return!0},toArray=function(e){for(var t=Array(e.length),r=0;t.length>r;++r)t[r]=e[r];return t},addQueryString=function(e,t,r){return includes(e,t)?e:e.indexOf("?")>-1?e+"&"+t+"="+r:e+"?"+t+"="+r},addFormUrlEncoded=function(e,t,r){return includes(e,t)?e:e+"&"+t+"="+r},isMobile=function(){return navigator.userAgent.match(/.*(iPhone|iPad|Android|ios|SymbianOS|Windows Phone|ArkWeb).*/i)},isAliApp=function(e){void 0===e&&(e="[\\w-]+");try{var t=(null===navigator||void 0===navigator?void 0:navigator.userAgent)||"";return RegExp(e+"(-PD)?/","i").test(t)}catch(r){return!1}},isWindVaneAvailable=function(){return window.WindVane&&window.WindVane.isAvailable},isRendered=function(e){if(e&&!document.getElementById(e.id))return!1;var t=e&&e.querySelector(".nc_wrapper"),r=e&&e.querySelector("._nc");return!!t||!!r};function addVersionToUrl(e){return getStore("options",{}).addVersionToUrl?!e||endsWith(e,".js")||endsWith(e,".css")||includes(e,"_bx-v")?e:addQueryString(e,"_bx-v",version):e}function endsWith(e,t){return!!e&&e.substring(e.length-t.length)===t}function formatJsonp(e){return void 0===e&&(e=""),e.substring(e.indexOf("{"),e.lastIndexOf("}")+1)}var formatInjectOptions=function(options){if("string"==typeof options.checkApiPath){var reg_1=options.checkApiPath+"";options.checkApiPath=function(e){return RegExp(reg_1).test(e)}}if("string"==typeof options.renderTo&&(options.renderTo=document.querySelector(options.renderTo)),"string"==typeof options.renderNC&&(options.renderNC="true"===options.renderNC),"string"==typeof options.awscTimeout&&(options.awscTimeout=+options.awscTimeout),"string"==typeof options.showCallback){var _showCallback_1=options.showCallback+"";options.showCallback=function(){eval(_showCallback_1)}}if("string"==typeof options.hideCallback){var _hideCallback_1=options.hideCallback+"";options.hideCallback=function(){eval(_hideCallback_1)}}return options},isGray=function(){var e=document.currentScript&&document.currentScript.src;if(e&&e.indexOf("ratio")>-1){var t=e.match(/ratio=([^&]+)/),r=+encodeURIComponent(t&&t[1]);return Math.random()<=r}return!0};function getCurrentJSDomain(){var e=getCurrentScript(),t=e&&e.src?e.src.match(/https\:\/\/([^&]+).alicdn/):null;t||(t=e&&e.src?e.src.match(/https\:\/\/([^&]+).slatic.net/):[,"g"]);var r=t&&t[1],n="";return-1===["laz-g-cdn","aeis","assets","lazada-slatic-g","lzd-g"].indexOf(r)&&(r="g"),"lzd-g"===r?n="https://"+r+".slatic.net/g/":(n="https://"+r+".alicdn.com/","assets"===r&&(n+="g/")),n}function getCurrentScript(){if(document.currentScript)return document.currentScript;var e=null,t=document.getElementsByTagName("script"),r=null;try{throw Error()}catch(a){var n,o=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(a.stack)||[!1])[1];for(n in t)if((r=t[n]).src==o||"interactive"==r.readyState)return e=t[n],t[n]}return e}function getDomain(e){var t=e.match(/(https?:\/\/)?((([\w-]+\.)+\w+)|localhost)(:\d{1,5})?/g);return t&&t[0]||""}function crossOrigin(e){try{return!e||("string"==typeof e&&(0===e.indexOf("data:")||e.length>1e4)||(e.url?e=e.url:e.href?e=e.href:"[object Array]"===Object.prototype.toString.call(e)&&(e=e[0]),"/"!==e.substring(0,1)?host!==getDomain(e):"//"===e.substring(0,2)&&host!==getDomain(location.protocol+e)))}catch(t){return log("跨域校验异常,message:"+t,1,1),!0}}function findDomain(e){try{return e&&("string"!=typeof e||0!==e.indexOf("data:")&&1e4>=e.length)?(e.url?e=e.url:e.href?e=e.href:"[object Array]"===Object.prototype.toString.call(e)&&(e=e[0]),"/"!==e.substring(0,1)||"//"===e.substring(0,2)?getDomain(e).replace("https://","").replace("http://",""):location.host||location.hostname):""}catch(t){return log("域名解析失败,message:"+t,1,1),""}}var isEffectHeaderCookieUrl=function(e,t,r){if(!e||"string"==typeof e&&(0===e.indexOf("data:")||e.length>1e4))return!1;e.url?e=e.url:e.href?e=e.href:"[object Array]"===Object.prototype.toString.call(e)&&(e=e[0]);var n=e+t,o=getStore("handleEffectHeaderCookieUrl",{});if("boolean"==typeof o[e+"fetch"]&&"xhr"===t)return!1;var a=!1;return r(e)&&(a=!0),o[n]=a,setStore("handleEffectHeaderCookieUrl",o),a},host=location.protocol+"//"+location.host,version="2.5.36",loc=location,doc=document,log=function(e,t,r,n,o){if(void 0===t&&(t=1),void 0===r&&(r=.1),0>=r||Math.random()<r){var a={code:t,msg:(e+"").substr(0,1e3)+";v:"+version,pid:"baxia",page:loc.href.split(/[#?]/)[0],query:loc.search.substr(1),hash:loc.hash,referrer:doc.referrer,title:doc.title,ua:navigator.userAgent};n&&(a.c1=n),o&&(a.c2=o),_send(a,"//gm.mmstat.com/fsp.1.1?")}};function importantLog(e){log(e,13,.1)}function veryImportantLog(e){logLine truncated
|
||||
Reference in new issue
Block a user