diff options
Diffstat (limited to 'ext/bg/js/clipboard-monitor.js')
-rw-r--r-- | ext/bg/js/clipboard-monitor.js | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/bg/js/clipboard-monitor.js b/ext/bg/js/clipboard-monitor.js index c2f41385..c102572f 100644 --- a/ext/bg/js/clipboard-monitor.js +++ b/ext/bg/js/clipboard-monitor.js @@ -18,18 +18,15 @@ /*global apiClipboardGet, jpIsStringPartiallyJapanese*/ -class ClipboardMonitor { +class ClipboardMonitor extends EventDispatcher { constructor() { + super(); this.timerId = null; this.timerToken = null; this.interval = 250; this.previousText = null; } - onClipboardText(_text) { - throw new Error('Override me'); - } - start() { this.stop(); @@ -55,7 +52,7 @@ class ClipboardMonitor { ) { this.previousText = text; if (jpIsStringPartiallyJapanese(text)) { - this.onClipboardText(text); + this.trigger('change', {text}); } } |