const nativeRef = ( ) => { const iframe = document . createElement ( 'iframe' ) ; iframe . setAttribute ( 'style' , 'display: none !important' ) ; document . documentElement . appendChild ( iframe ) ; return iframe . contentWindow as Window & { [ key ] : any ; } ; } ; if ( ( window as any ) . MooTools ) { const window = nativeRef ( ) ; Function . prototype . bind = window . Function . prototype . bind ; }