- 掃描 ID:
- dd776275-146b-4d07-b403-42ca25614255已完成
- 已提交的 URL:
- https://preview-react.playcode.io/
- 報告完成時間:
連結 · 找到 0 個
從頁面中識別的傳出連結
JavaScript 變數 · 找到 3 個
在頁面的視窗物件上載入的全域 JavaScript 變數是在函數外部宣告的變數,可從目前範圍內程式碼中的任何位置存取
名稱 | 類型 |
---|---|
onbeforetoggle | object |
documentPictureInPicture | object |
onscrollend | object |
主控台記錄訊息 · 找到 0 條
記錄到 Web 主控台的訊息
HTML
頁面的原始 HTML 主體
<html><head>
<script>
(()=>{var B=Object.create;var h=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(t,e,r)=>e in t?h(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var u=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var $=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of U(e))!J.call(t,i)&&i!==r&&h(t,i,{get:()=>e[i],enumerable:!(n=L(e,i))||n.enumerable});return t};var R=(t,e,r)=>(r=t!=null?B(V(t)):{},$(e||!t||!t.__esModule?h(r,"default",{value:t,enumerable:!0}):r,t));var a=(t,e,r)=>(Q(t,typeof e!="symbol"?e+"":e,r),r);var O=u(f=>{"use strict";Object.defineProperty(f,"__esModule",{value:!0});var l=[];l[0]=function(){return function(){}};l[1]=function(t,e){return typeof e>"u"?t:function(n){t(n,e)}};function z(t){return l[t]||(l[t]=X(t)),l[t]}function X(t){for(var e="return function dispatcher"+t+`(payload) {
`,r=[],n=[],i=0;i<t;i++)r.push("cb"+i),n.push("ctx"+i),e+=" cb"+i+"(payload, ctx"+i+`);
`;return e+="};",new(Function.bind.apply(Function,[void 0].concat(r.concat(n),[e])))}var Y=function(){function t(){this.hasHandlers=!1,this._handlers=[],this._contexts=[],this._createDispatcher()}return t.prototype.addHandler=function(e,r){return this.isHandlerAttached(e,r)||(this._handlers.push(e),this._contexts.push(r),this._createDispatcher(),this._updateHasHandlers()),this},t.prototype.removeHandler=function(e,r){var n=this._getHandlerIndex(e,r);return typeof n<"u"&&(this._handlers.splice(n,1),this._contexts.splice(n,1),this._createDispatcher(),this._updateHasHandlers()),this},t.prototype.isHandlerAttached=function(e,r){return typeof this._getHandlerIndex(e,r)<"u"},t.prototype._updateHasHandlers=function(){this.hasHandlers=!!this._handlers.length},t.prototype._getHandlerIndex=function(e,r){var n=this._handlers.length,i;for(i=0;i<n&&!(this._handlers[i]===e&&this._contexts[i]===r);i++);return i<n?i:void 0},t.prototype._createDispatcher=function(){this.dispatch=z(this._handlers.length).apply(this,this._handlers.concat(this._contexts))},t}();f.default=Y});var M=u(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});var Z=O();y.Event=Z.default});var N=u(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});var ee=M(),A="resolve_transaction",C="reject_transaction",j="error",g=function(){function t(e,r){r===void 0&&(r=0),this._dispatch=e,this._rpcTimeout=r,this.error=new ee.Event,this._rpcHandlers={},this._signalHandlers={},this._pendingTransactions={},this._nextTransactionId=0}return t.prototype.dispatch=function(e,r){var n=e;switch(n.__type){case t.MessageType.signal:return this._handleSignal(n,r);case t.MessageType.rpc:return this._handeRpc(n,r);case t.MessageType.internal:return this._handleInternal(n);default:this._raiseError("invalid message type "+n.__type)}},t.prototype.rpc=function(e,r,n,i){var o=this;i===void 0&&(i={});var c=this._nextTransactionId++;return this._dispatch({__rpc:!0,__type:t.MessageType.rpc,__transactionId:c,__id:e,__payload:r},n||void 0),new Promise(function(G,K){var q=o._pendingTransactions[c]={id:c,resolve:G,reject:K},P=i.timeout||o._rpcTimeout;P>0&&(o._pendingTransactions[c].timeoutHandle=setTimeout(function(){return o._transactionTimeout(q)},P))})},t.prototype.signal=function(e,r,n){return this._dispatch({__rpc:!0,__type:t.MessageType.signal,__id:e,__payload:r},n||void 0),this},t.prototype.registerRpcHandler=function(e,r){if(this._rpcHandlers[e])throw new Error("rpc handler for "+e+" already registered");return this._rpcHandlers[e]=r,this},t.prototype.registerSignalHandler=function(e,r){return this._signalHandlers[e]||(this._signalHandlers[e]=[]),this._signalHandlers[e].push(r),this},t.prototype.deregisterRpcHandler=function(e,r){return this._rpcHandlers[e]&&delete this._rpcHandlers[e],this},t.prototype.deregisterSignalHandler=function(e,r){return this._signalHandlers[e]&&(this._signalHandlers[e]=this._signalHandlers[e].filter(function(n){return r!==n})),this},t.prototype._raiseError=function(e){this.error.dispatch(new Error(e)),this._dispatch({__rpc:!0,__type:t.MessageType.internal,__id:j,__payload:e})},t.prototype._handleSignal=function(e,r){if(!this._signalHandlers[e.__id])return this._raiseError("invalid signal "+e.__id);this._signalHandlers[e.__id].forEach(function(n){return n(e.__payload,r)})},t.prototype._handeRpc=function(e,r){var n=this;if(!this._rpcHandlers[e.__id])return this._raiseError("invalid rpc "+e.__id);Promise.resolve(this._rpcHandlers[e.__id](e.__payload,r)).then(function(i){return n._dispatch({__rpc:!0,__type:t.MessageType.internal,__id:A,__transactionId:e.__transactionId,__payload:i})},function(i){return n._dispatch({__rpc:!0,__type:t.MessageType.internal,__id:C,__transactionId:e.__transactionId,__payload:i})})},t.prototype._handleInternal=function(e){var r=typeof e.__transactionId<"u"?this._pendingTransactions[e.__transactionId]:void 0;switch(e.__id){case A:if(!r||typeof e.__transactionId>"u")return this._raiseError("no pending transaction with id "+e.__transactionId);r.resolve(e.__payload),this._clearTransaction(this._pendingTransactions[e.__transactionId]);break;case C:if(!r||typeof e.__transactionId>"u")return this._raiseError("no pending transaction with id "+e.__transactionId);this._pendingTransactions[e.__transactionId].reject(e.__payload),this._clearTransaction(this._pendingTransactions[e.__transactionId]);break;case j:this.error.dispatch(new Error("remote error: "+e.__payload));break;default:this._raiseError("unhandled internal message "+e.__id);break}},t.prototype._transactionTimeout=function(e){e.reject("transaction timed out"),this._raiseError("transaction "+e.id+" timed out"),delete this._pendingTransactions[e.id]},t.prototype._clearTransaction=function(e){typeof e.timeoutHandle<"u"&&clearTimeout(e.timeoutHandle),delete this._pendingTransactions[e.id]},t}();(function(t){var e;(function(r){r[r.signal=0]="signal",r[r.rpc=1]="rpc",r[r.internal=2]="internal"})(e=t.MessageType||(t.MessageType={}))})(g||(g={}));v.default=g});var m=u(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});var re=N();w.RpcProvider=re.default});function E(){try{return window.self!==window.top}catch{return!0}}var S=E(),x=!E();function b(t){return new Proxy(t,{get(e,r,n){let i=Symbol.for("__"+r+"__");if(!!i)return e[i]},set(e,r,n){let i=Symbol.for("__"+r+"__");return e[i]=n}})}var s=b(document),le=b(window);var D=R(m());var H=function(t,e,r=null){let n=new Promise((i,o)=>{let c=setTimeout(()=>{clearTimeout(c),o(r||"Timed out in "+t+"ms.")},t)});return Promise.race([e,n])};var te=console,ne=15*1e3,W=5*1e3,d=class{constructor(e=ne){this.requestTimeout=e;a(this,"rpcProvider");a(this,"isClosed");a(this,"closers");a(this,"rpc");a(this,"signal");this.isClosed=!1,this.closers=new Set;let r=this;this.rpc=new Proxy({},{get:(n,i,o)=>async function(){return await r.rpcRaw(i,...arguments)}}),this.signal=new Proxy({},{get:(n,i,o)=>function(){return r.signalRaw(i,...arguments)}}),this.init()}init(){throw new Error("Not implemented")}registerRpcHandler(e,r){this.closers.add(async()=>{this.rpcProvider.deregisterRpcHandler(e,r)}),this.rpcProvider.registerRpcHandler(e,r)}registerSignalHandler(e,r){this.closers.add(async()=>{this.rpcProvider.deregisterSignalHandler(e,r)}),this.rpcProvider.registerSignalHandler(e,r)}async rpcRaw(e,r,n){return this.rpcProvider.rpc(e,r,n||void 0)}signalRaw(e,r,n){return this.rpcProvider.signal(e,r,n||void 0),this}async close(e){this.isClosed=!0;let r=[];e&&r.push(H(W,this.rpcProvider.signal("close")));for(let n of this.closers)r.push(H(W,n()));this.closers=new Set;try{await Promise.all(r)}catch(n){te.warn("BaseRpc: close error:",n)}}};var _=class extends d{constructor(){super(3e4)}init(){this.rpcProvider=new D.RpcProvider((e,r)=>{window.parent.postMessage(e,"*",r)},this.requestTimeout)}listen(){let e=r=>{!r.data||!r.data.__rpc||this.rpcProvider.dispatch(r.data,r)};window.addEventListener("message",e),this.closers.add(async()=>{window.removeEventListener("message",e)})}};var k=R(m());var p=class extends d{constructor(){super(3e4)}init(){let e=null;ie()&&(e=new BroadcastChannel("__playcode:preview")),this.rpcProvider=new k.RpcProvider(async n=>{e?.postMessage(n)},this.requestTimeout);let r=n=>{!n.data||!n.data.__rpc||this.rpcProvider.dispatch(n.data,n)};e?.addEventListener("message",r),this.closers.add(async()=>{e?.removeEventListener("message",r),e?.close()})}};function ie(){if(!("BroadcastChannel"in self))return!1;try{return new BroadcastChannel("feature_test").close(),!0}catch{return!1}}var T=class{constructor(){a(this,"silent");this.silent=!0}log(...e){if(this.silent)return;(s.console||console).log(...arguments)}debug(...e){if(this.silent)return;(s.console||console).debug(...arguments)}warn(...e){(s.console||console).warn(...arguments)}error(...e){(s.console||console).error(...arguments)}},se=new T,I=se;I.silent=!0;function F(t){document.open(),document.write(`
<head>
<script>
${t}
<\/script>
</head>
<body>
<!-- <h1>__previewFull__</h1>-->
</body>
`),document.close()}async function ae(){s.rpcGlobalApp=new _,s.rpcPreviewWindow=new p,s.rpcPreviewWindow.registerRpcHandler("preview:loadScript",t=>s.rpcGlobalApp.rpcRaw("preview:loadScript",t)),s.rpcGlobalApp.listen(),s.rpcGlobalApp.rpcRaw("preview:loadScript",{}).then(t=>{F(t)}).catch(console.error)}function ce(){s.rpcPreviewWindow=new p,s.rpcPreviewWindow.rpcRaw("preview:loadScript",{}).then(t=>{F(t)}).catch(t=>{I.warn("preview:loadScript",t)})}S&&ae();x&&ce();})();
</script>
</head>
<body>
<!-- <h1>__preview__</h1>-->
</body></html>