diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js index 5f9e172d..6d0a5f0e 100644 --- a/ext/mixed/js/core.js +++ b/ext/mixed/js/core.js @@ -318,10 +318,10 @@ const yomichan = (() => { } getTemporaryListenerResult(eventHandler, userCallback, timeout=null) { - if ( - typeof eventHandler.addListener === 'undefined' || - typeof eventHandler.removeListener === 'undefined' - ) { + if (!( + typeof eventHandler.addListener === 'function' || + typeof eventHandler.removeListener === 'function' + )) { throw new Error('Event handler type not supported'); }