diff options
Diffstat (limited to 'ext/bg/js/yomichan.js')
-rw-r--r-- | ext/bg/js/yomichan.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js index 2b713c02..e8956057 100644 --- a/ext/bg/js/yomichan.js +++ b/ext/bg/js/yomichan.js @@ -29,6 +29,7 @@ class Yomichan { chrome.runtime.onMessage.addListener(this.onMessage.bind(this)); chrome.browserAction.onClicked.addListener(this.onBrowserAction.bind(this)); + chrome.runtime.onInstalled.addListener(this.onInstalled.bind(this)); loadOptions().then(opts => { this.setOptions(opts); @@ -38,6 +39,12 @@ class Yomichan { }); } + onInstalled(details) { + if (details.reason === 'install') { + chrome.tabs.create({url: chrome.extension.getURL('bg/guide.html')}); + } + } + onMessage(request, sender, callback) { const {action, params} = request, method = this['api_' + action]; |