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:
authorDmitrii Selivanov <selivano.d@gmail.com>2022-04-27 00:08:52 +0300
committerGitHub <noreply@github.com>2022-04-27 00:08:52 +0300
commitc3c13738e7a49209c8a40852bbefd71ce6323400 (patch)
treeb0b8420bf01bcd201929ad32bcab9493e763e0f0
parenta4806c1f478c444d365c06c45000a3c2143b2ed4 (diff)
parent55cc2879eecf35fe0cc5ac3ba716b76f83de251e (diff)
Merge pull request #556 from bershanskiy/fix-onInstalled
Fix: do not open changelog if not needed
-rw-r--r--Extensions/combined/ryd.background.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/Extensions/combined/ryd.background.js b/Extensions/combined/ryd.background.js
index 944c57a..9e749cf 100644
--- a/Extensions/combined/ryd.background.js
+++ b/Extensions/combined/ryd.background.js
@@ -73,6 +73,18 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => {
}
});
+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")});
+})
+
// api.storage.sync.get(['lastShowChangelogVersion'], (details) => {
// if (extConfig.showUpdatePopup === true &&
// details.lastShowChangelogVersion !== chrome.runtime.getManifest().version
@@ -84,6 +96,7 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => {
// }
// });
+
async function sendVote(videoId, vote) {
api.storage.sync.get(null, async (storageResult) => {
if (!storageResult.userId || !storageResult.registrationConfirmed) {