nl_tokens: Returns a method that will act like ipc . send depending on the parameter passed to it so you don t have to check for webContents .
pl_tokens: function getSendMethod ( windowOrWebView ) { if ( ! windowOrWebView ) return ( ... a ) => ipc . send ( ... a ) ; if ( 'webContents' in windowOrWebView ) { return ( ... a ) => { d ( ` ${ JSON . stringify ( a ) } ` ) ; if ( ! windowOrWebView . webContents . isDestroyed ( ) ) { windowOrWebView . webContents . send ( ... a ) ; } else { throw <mask> Error ( ` ` ) ; } } ; } else { return ( ... a ) => { d ( ` ${ JSON . stringify ( a ) } ` ) ; windowOrWebView . send ( ... a ) ; } ; } }