diff options
Diffstat (limited to 'Extensions/combined/ryd.background.js')
-rw-r--r-- | Extensions/combined/ryd.background.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Extensions/combined/ryd.background.js b/Extensions/combined/ryd.background.js index 18eb0fa..08f6afa 100644 --- a/Extensions/combined/ryd.background.js +++ b/Extensions/combined/ryd.background.js @@ -74,9 +74,16 @@ 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(['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}); + } + }); async function sendVote(videoId, vote) { api.storage.sync.get(null, async (storageResult) => { |