Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Anarios/return-youtube-dislike.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Bershanskiy <8knots@protonmail.com>2022-04-20 23:06:06 +0300
committerAnton Bershanskiy <8knots@protonmail.com>2022-04-20 23:06:06 +0300
commit7d742a7ea682efe690f2dfe71b566127d1195cda (patch)
tree56c14d0ef475041c42a785eccea6fd7d8fe1a0c5
parent2e6ed5298b7851b7ea84dcfa298167689f516496 (diff)
Fix: do not open changelog if not needed
-rw-r--r--Extensions/combined/ryd.background.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/Extensions/combined/ryd.background.js b/Extensions/combined/ryd.background.js
index 18eb0fa..d89f39d 100644
--- a/Extensions/combined/ryd.background.js
+++ b/Extensions/combined/ryd.background.js
@@ -74,9 +74,19 @@ 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.runtime.onInstalled.addListener((details) => {
+ if (
+ // No need to show changelog if its was a browser update (and not extension update)
+ details.reason === "browser_update" ||
+ // No need to show changelog if developer just reloaded the extension
+ (details.reason === "update" &&
+ details.previousVersion === chrome.runtime.getManifest().version)
+ )
+ return;
+ api.tabs.create({
+ url: api.runtime.getURL("/changelog/3/changelog_3.0.html"),
+ });
+});
async function sendVote(videoId, vote) {
api.storage.sync.get(null, async (storageResult) => {