From 282ada3b91a742ff28825aa3ebb824e066e24252 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 23 Jul 2016 23:02:55 -0700 Subject: [PATCH] Fixing exception --- ext/bg/js/yomichan.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js index aaf6dcc8..bf277a2f 100644 --- a/ext/bg/js/yomichan.js +++ b/ext/bg/js/yomichan.js @@ -40,7 +40,7 @@ class Yomichan { chrome.runtime.onInstalled.addListener(this.onInstalled.bind(this)); chrome.runtime.onMessage.addListener(this.onMessage.bind(this)); chrome.browserAction.onClicked.addListener(this.onBrowserAction.bind(this)); - chrome.tabs.onCreated.addListener(this.onTabReady.bind(this)); + chrome.tabs.onCreated.addListener((tab) => this.onTabReady(tab.id)); chrome.tabs.onUpdated.addListener(this.onTabReady.bind(this)); loadOptions((opts) => { @@ -68,12 +68,12 @@ class Yomichan { return true; } - onTabReady(tab) { - this.tabInvoke(tab, 'setOptions', this.options); - this.tabInvoke(tab, 'setEnabled', this.state === 'enabled'); + onTabReady(tabId) { + this.tabInvoke(tabId, 'setOptions', this.options); + this.tabInvoke(tabId, 'setEnabled', this.state === 'enabled'); } - onBrowserAction(tab) { + onBrowserAction() { switch (this.state) { case 'disabled': this.setState('loading');