aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-14 21:02:04 -0800
committerAlex Yatskov <alex@foosoft.net>2016-11-14 21:02:04 -0800
commit09afc649283debabc7087ed4242b5c53ea2dfd9a (patch)
treeb4f050075e021c13a603caa5b8fbd19761873c5a /ext/bg/js
parent4e89d27fda22c73c6dc7f334ad355ec7a56beba7 (diff)
Open guide on install
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/yomichan.js7
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];