Merge pull request #537 from sy-b/patch-1

Show changelog only on installation
This commit is contained in:
Dmitrii Selivanov authored and GitHub committed 2022-04-26 18:40:44 +02:00
commit b23857f710
3 files changed
+17 -8

No files matched your search

+5 -5
View File
@@ -30,11 +30,7 @@
<button id="link_website" title="__MSG_linkWebsite__"> <button id="link_website" title="__MSG_linkWebsite__">
__MSG_linkWebsite__ __MSG_linkWebsite__
</button> </button>
<button <button style="margin-top: 0.3em; background: #ff0000" id="link_donate" title="__MSG_linkDonate__">
style="margin-top: 0.3em; background: #ff0000"
id="link_donate"
title="__MSG_linkDonate__"
>
__MSG_linkDonate__ __MSG_linkDonate__
</button> </button>
<button id="link_discord">Discord</button> <button id="link_discord">Discord</button>
@@ -46,6 +42,10 @@
<button style="margin-top: 0.3em" id="link_help" title="__MSG_linkHelp__"> <button style="margin-top: 0.3em" id="link_help" title="__MSG_linkHelp__">
__MSG_linkHelp__ __MSG_linkHelp__
</button> </button>
<br>
<button style="margin-top: 0.3em" id="link_changelog" title="__MSG_linkChangelog__">
Change Log
</button>
<br/> <br/>
<br/> <br/>
+2
View File
@@ -19,6 +19,7 @@ const config = {
donate: "https://returnyoutubedislike.com/donate", donate: "https://returnyoutubedislike.com/donate",
faq: "https://returnyoutubedislike.com/faq", faq: "https://returnyoutubedislike.com/faq",
help: "https://returnyoutubedislike.com/help", help: "https://returnyoutubedislike.com/help",
changelog: "/changelog/3/changelog_3.0.html"
}, },
}; };
@@ -49,6 +50,7 @@ createLink(config.links.discord, "link_discord");
createLink(config.links.faq, "link_faq"); createLink(config.links.faq, "link_faq");
createLink(config.links.donate, "link_donate"); createLink(config.links.donate, "link_donate");
createLink(config.links.help, "link_help"); createLink(config.links.help, "link_help");
createLink(config.links.changelog, "link_changelog");
function createLink(url, id) { function createLink(url, id) {
document.getElementById(id).addEventListener("click", () => { document.getElementById(id).addEventListener("click", () => {
+10 -3
View File
@@ -74,9 +74,16 @@ api.runtime.onMessage.addListener((request, sender, sendResponse) => {
} }
}); });
api.runtime.onInstalled.addListener(() => { api.storage.sync.get(['lastShowChangelogVersion'], (details) => {
api.tabs.create({url: api.runtime.getURL("/changelog/3/changelog_3.0.html")}); 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) { async function sendVote(videoId, vote) {
api.storage.sync.get(null, async (storageResult) => { api.storage.sync.get(null, async (storageResult) => {