File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 1+ import LoggerCore from "../logger/core" ;
12import { Channel } from "./channel" ;
23import {
34 ChannelManager ,
@@ -107,15 +108,6 @@ export default class MessageContent
107108
108109 nativeSend ( data : any ) : void {
109110 let detail = data ;
110- if ( typeof cloneInto !== "undefined" ) {
111- try {
112- // eslint-disable-next-line no-undef
113- detail = cloneInto ( detail , document . defaultView ) ;
114- } catch ( e ) {
115- // eslint-disable-next-line no-console
116- console . log ( e ) ;
117- }
118- }
119111
120112 // 特殊处理relatedTarget
121113 if ( detail . data && typeof detail . data . relatedTarget === "object" ) {
@@ -135,6 +127,18 @@ export default class MessageContent
135127 document . dispatchEvent ( ev ) ;
136128 }
137129
130+ if ( typeof cloneInto !== "undefined" ) {
131+ try {
132+ LoggerCore . getLogger ( ) . info ( "nativeSend" ) ;
133+ // eslint-disable-next-line no-undef
134+ detail = cloneInto ( detail , document . defaultView ) ;
135+ } catch ( e ) {
136+ // eslint-disable-next-line no-console
137+ console . log ( e ) ;
138+ LoggerCore . getLogger ( ) . info ( "error data" ) ;
139+ }
140+ }
141+
138142 const ev = new CustomEvent ( ( this . isContent ? "fd" : "ct" ) + this . eventId , {
139143 detail,
140144 } ) ;
You can’t perform that action at this time.
0 commit comments