diff options
author | Dmitrii Selivanov <selivano.d@gmail.com> | 2022-04-26 20:00:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 20:00:09 +0300 |
commit | 43380c83c3b62f25cdeb1a68e503aa9de4dff905 (patch) | |
tree | 728467f67c678b7d2528b4536f1a9506b8933e8d /Extensions/combined/ryd.background.js | |
parent | 75e98a1e6e57c6bed6f5cd4ba044f06460a9598e (diff) | |
parent | 8bb6ef73fb7ff7516136dcf65fb70a63b8c70bfb (diff) |
Merge branch 'main' into extOptionFormatLikes
Diffstat (limited to 'Extensions/combined/ryd.background.js')
-rw-r--r-- | Extensions/combined/ryd.background.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Extensions/combined/ryd.background.js b/Extensions/combined/ryd.background.js index e1eb0be..10b08d2 100644 --- a/Extensions/combined/ryd.background.js +++ b/Extensions/combined/ryd.background.js @@ -73,12 +73,16 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => { } }); -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.get(['lastShowChangelogVersion'], (details) => { + if (extConfig.showUpdatePopup === true && + details.lastShowChangelogVersion !== chrome.runtime.getManifest().version + ) { + // keep it inside get to avoid race condition + api.storage.sync.set({'lastShowChangelogVersion ': chrome.runtime.getManifest().version}); + // wait until async get runs & don't steal tab focus + api.tabs.create({url: api.runtime.getURL("/changelog/3/changelog_3.0.html"), active: false}); } }); -api.storage.sync.set({'newInstallation': false}); async function sendVote(videoId, vote) { api.storage.sync.get(null, async (storageResult) => { |