import BasePlugin from "./basePlugin" ; export default class DoNotOpenLinksOnApp extends BasePlugin { public constructor ( name , settings ) { super ( name , settings ) ; let overriden = false ; const originalHasFocus = document . hasFocus . bind ( document ) ; document . hasFocus = ( ) => { if ( ! overriden ) { const w = window as any ; if ( w . TS && w . TS . magic_login && w . TS . magic_login . execute ) { w . TS . magic_login . execute = ( obj ) => { window . location . href = obj . browser_uri ; } ; overriden = true ; } } return originalHasFocus ( ) ; } ; } }