diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-07-23 23:02:55 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-07-23 23:02:55 -0700 |
commit | 282ada3b91a742ff28825aa3ebb824e066e24252 (patch) | |
tree | 34a5dd55af9ba426adcf2843f58c5507a95e1230 /ext/bg/js | |
parent | e062ae2063b4a4aa3b284816adee3350e5670a20 (diff) |
Fixing exception
Diffstat (limited to 'ext/bg/js')
-rw-r--r-- | ext/bg/js/yomichan.js | 10 |
1 files 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'); |