瀏覽代碼

Show changelog only on installation

fixes #534
sy-b 3 年之前
父節點
當前提交
b73aaddb59
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      Extensions/combined/ryd.background.js

+ 6 - 3
Extensions/combined/ryd.background.js

@@ -74,9 +74,12 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => {
   }
 });
 
-api.runtime.onInstalled.addListener(() => {
-  api.tabs.create({url: api.runtime.getURL("/changelog/3/changelog_3.0.html")});
-})
+api.storage.sync.get(['newInstallation'], (result) => {
+  if (result.newInstallation !== false) {
+    api.tabs.create({url: api.runtime.getURL("/changelog/3/changelog_3.0.html")});
+  }
+});
+api.storage.sync.set({'newInstallation': false});
 
 async function sendVote(videoId, vote) {
   api.storage.sync.get(null, async (storageResult) => {