
管理员
站长
- UID
- 1
- 积分
- 224400
- 余额
- 13 R
- Moe币
- 84881
- 在线时间
- 279 小时
- 注册时间
- 2025-12-28
- 最后登录
- 2026-11-9
|
|
ototype.removeChild=function(s){if(s!=null&&s.__MICRO_APP_NAME__){const a=y.get(s.__MICRO_APP_NAME__);if(a!=null&&a.container)return en(a,l.rawRemoveChild,this,Zr(s));try{return l.rawRemoveChild.call(this,s)}catch{return(s==null?void 0:s.parentNode)&&l.rawRemoveChild.call(s.parentNode,s)}}return l.rawRemoveChild.call(this,s)},r.prototype.append=t.prototype.append=function(...s){let a=0;for(;a<s.length;){let c=s[a];c=ye(c)?c:l.rawCreateTextNode.call(l.rawDocument,c),De(this,be(c),null,ze(this)?l.rawFragmentAppend:l.rawAppend),a++}},r.prototype.prepend=t.prototype.prepend=function(...s){let a=s.length,c=l.rawPrepend;for((ze(this)||Ln(this))&&(c=l.rawFragmentPrepend);a>0;){let h=s[a-1];h=ye(h)?h:l.rawCreateTextNode.call(l.rawDocument,h),De(this,be(h),null,c),a--}},t.prototype.insertAdjacentElement=function(i,s){var a;if(s!=null&&s.__MICRO_APP_NAME__&&ce(s)){const c=y.get(s.__MICRO_APP_NAME__);if(c!=null&&c.container){const h=kr(s,c);if(!ce(h))return s;const p=(a=tn(this,h,c))!==null&&a!==void 0?a:this;return l.rawInsertAdjacentElement.call(p,i,h)}}return l.rawInsertAdjacentElement.call(this,i,s)};function n(i){const s=Ve()||K();if((i===document.body||i===document.head)&&s){const a=y.get(s);if(a!=null&&a.container){if(i===document.body)return a.querySelector("micro-app-body");if(i===document.head)return a.querySelector("micro-app-head")}}return i}function o(i,s,a,c,h){if(i){const p=Ve()||K();if(p&&we(p)){const S=y.get(p);if(xn(s))return S.sandBox.microHead[h](c);if(Ye(s))return S.sandBox.microBody[h](c)}}return a}t.prototype.querySelector=function(s){var a;const c=(a=n(this))!==null&&a!==void 0?a:this,h=l.rawElementQuerySelector.call(c,s);return o(Te(h)&&c!==this,c,h,s,"querySelector")},t.prototype.querySelectorAll=function(s){var a;const c=(a=n(this))!==null&&a!==void 0?a:this,h=l.rawElementQuerySelectorAll.call(c,s);return o(!h.length&&c!==this,c,h,s,"querySelectorAll")},t.prototype.setAttribute=function(s,a){var c;if(/^micro-app(-\S+)?/i.test(this.tagName)&&s==="data"&&this.setAttribute!==t.prototype.setAttribute)this.setAttribute(s,a);else{const h=this.__MICRO_APP_NAME__||K();if(h&&y.has(h)&&((s==="src"||s==="srcset")&&/^(img|script|video|audio|source|embed)$/i.test(this.tagName)||s==="href"&&/^(link|image)$/i.test(this.tagName)||s==="href"&&/^(a)$/i.test(this.tagName)&&!/^#/.test(a))){const p=y.get(h);a=X(a,p.url)}if(l.rawSetAttribute.call(this,s,a),ar(this)||Dn(this)||On(this)){let p=!1;!((c=w==null?void 0:w.options)===null||c===void 0)&&c.includeCrossOrigin&&P(w.options.includeCrossOrigin)&&(p=w.options.includeCrossOrigin(a)),p&&(node.crossOrigin="anonymous")}}},H(e.prototype,"parentNode",{configurable:!0,enumerable:!0,get(){var i,s,a;const c=Ve()||K();if(c&&this===l.rawDocument.firstElementChild){const p=(a=(s=(i=y.get(c))===null||i===void 0?void 0:i.sandBox)===null||s===void 0?void 0:s.proxyWindow)===null||a===void 0?void 0:a.document;if(p)return p}return l.rawParentNodeDesc.get.call(this)}}),H(t.prototype,"innerHTML",{configurable:!0,enumerable:!0,get(){return l.rawInnerHTMLDesc.get.call(this)},set(i){l.rawInnerHTMLDesc.set.call(this,i);const s=this.__MICRO_APP_NAME__||Ve()||K();Array.from(this.children).forEach(a=>{ce(a)&&s&&F(a,s)})}}),e.prototype.cloneNode=function(s){const a=l.rawCloneNode.call(this,s);return F(a,this.__MICRO_APP_NAME__)}}function be(t){return F(t,K())}function Li(){const t=l.rawDocument,e=l.rawRootDocument;function r(i){return Nn(i)?t:i}e.prototype.createElement=function(s,a){const c=l.rawCreateElement.call(r(this),s,a);return be(c)},e.prototype.createElementNS=function(s,a,c){const h=l.rawCreateElementNS.call(r(this),s,a,c);return be(h)},e.prototype.createDocumentFragment=function(){const s=l.rawCreateDocumentFragment.call(r(this));return be(s)},e.prototype.createComment=function(s){const a=l.rawCreateComment.call(r(this),s);return be(a)};function n(i){var s,a;const c=r(this),h=K();return!h||!i||Pe(i)||t!==c?l.rawQuerySelector.call(c,i):(a=(s=y.get(h))===null||s===void 0?void 0:s.querySelector(i))!==null&&a!==void 0?a:null}function o(i){var s,a;const c=r(this),h=K();return!h||!i||Pe(i)||t!==c?l.rawQuerySelectorAll.call(c,i):(a=(s=y.get(h))===null||s===void 0?void 0:s.querySelectorAll(i))!==null&&a!==void 0?a:[]}e.prototype.querySelector=n,e.prototype.querySelectorAll=o,e.prototype.getElementById=function(s){const a=r(this);if(!K()||he(s))return l.rawGetElementById.call(a,s);try{return n.call(a,`#${s}`)}catch{return l.rawGetElementById.call(a,s)}},e.prototype.getElementsByClassName=function(s){const a=r(this);if(!K()||he(s))return l.rawGetElementsByClassName.call(a,s);try{return o.call(a,`.${s}`)}catch{return l.rawGetElementsByClassName.call(a,s)}},e.prototype.getElementsByTagName=function(s){var a;const c=r(this),h=K();if(!h||Pe(s)||he(s)||!(!((a=y.get(h))===null||a===void 0)&&a.inline)&&/^script$/i.test(s))return l.rawGetElementsByTagName.call(c,s);try{return o.call(c,s)}catch{return l.rawGetElementsByTagName.call(c,s)}},e.prototype.getElementsByName=function(s){const a=r(this);if(!K()||he(s))return l.rawGetElementsByName.call(a,s);try{return o.call(a,`[name=${s}]`)}catch{return l.rawGetElementsByName.call(a,s)}}}function xi(){const t=l.rawRootDocument;t.prototype.createElement=l.rawCreateElement,t.prototype.createElementNS=l.rawCreateElementNS,t.prototype.createDocumentFragment=l.rawCreateDocumentFragment,t.prototype.querySelector=l.rawQuerySelector,t.prototype.querySelectorAll=l.rawQuerySelectorAll,t.prototype.getElementById=l.rawGetElementById,t.prototype.getElementsByClassName=l.rawGetElementsByClassName,t.prototype.getElementsByTagName=l.rawGetElementsByTagName,t.prototype.getElementsByName=l.rawGetElementsByName}function nn(){$(),xi();const t=l.rawRootElement,e=l.rawRootNode;e. |
|