diff options
author | Dmitrii Selivanov <selivano.d@gmail.com> | 2022-04-26 19:40:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 19:40:44 +0300 |
commit | b23857f710a3befa1022f3506a117e2f001cdbc5 (patch) | |
tree | d203a103a75ebea9194a30f402db2b34bb530edf | |
parent | f062de36e4a00712f6a0996b686c5e639699cfbe (diff) | |
parent | b63a5c08eb18ecff2528c65262c1a07f8e6e4a8a (diff) |
Merge pull request #537 from sy-b/patch-1
Show changelog only on installation
-rw-r--r-- | Extensions/combined/popup.html | 94 | ||||
-rw-r--r-- | Extensions/combined/popup.js | 2 | ||||
-rw-r--r-- | Extensions/combined/ryd.background.js | 13 |
3 files changed, 59 insertions, 50 deletions
diff --git a/Extensions/combined/popup.html b/Extensions/combined/popup.html index aa2d6a8..aeaba4c 100644 --- a/Extensions/combined/popup.html +++ b/Extensions/combined/popup.html @@ -12,54 +12,54 @@ /> </head> <body> -<center> - <svg width="48" viewBox="0 0 24 24"> - <path - d="M14.9 3H6c-.9 0-1.6.5-1.9 1.2l-3 7c-.1.3-.1.5-.1.7v2c0 1.1.9 2 2 2h6.3l-.9 4.5c-.1.5 0 1 .4 1.4l1.1 1.1 6.5-6.6c.4-.4.6-.9.6-1.4V5c-.1-1.1-1-2-2.1-2zm7.4 12.8h-2.9c-.4 0-.7-.3-.7-.7V3.9c0-.4.3-.7.7-.7h2.9c.4 0 .7.3.7.7V15c0 .4-.3.8-.7.8z" - fill="red" + <center> + <svg width="48" viewBox="0 0 24 24"> + <path + d="M14.9 3H6c-.9 0-1.6.5-1.9 1.2l-3 7c-.1.3-.1.5-.1.7v2c0 1.1.9 2 2 2h6.3l-.9 4.5c-.1.5 0 1 .4 1.4l1.1 1.1 6.5-6.6c.4-.4.6-.9.6-1.4V5c-.1-1.1-1-2-2.1-2zm7.4 12.8h-2.9c-.4 0-.7-.3-.7-.7V3.9c0-.4.3-.7.7-.7h2.9c.4 0 .7.3.7.7V15c0 .4-.3.8-.7.8z" + fill="red" + /> + <path d="m8 12.5 5.1-2.9L8 6.7v5.8z" fill="#fff"/> + </svg> + <h1 style="margin-bottom: 0.75rem" title="__MSG_extensionName__"> + __MSG_extensionName__ + </h1> + <p style="color: var(--lightGrey)" title="__MSG_textDeveloper__"> + __MSG_textDeveloper__ + </p> + + <button id="link_website" title="__MSG_linkWebsite__"> + __MSG_linkWebsite__ + </button> + <button style="margin-top: 0.3em; background: #ff0000" id="link_donate" title="__MSG_linkDonate__"> + __MSG_linkDonate__ + </button> + <button id="link_discord">Discord</button> + <br/> + <button style="margin-top: 0.3rem" id="link_faq" title="__MSG_linkFAQ__"> + __MSG_linkFAQ__ + </button> + <button id="link_github">GitHub</button> + <button style="margin-top: 0.3em" id="link_help" title="__MSG_linkHelp__"> + __MSG_linkHelp__ + </button> + <br> + <button style="margin-top: 0.3em" id="link_changelog" title="__MSG_linkChangelog__"> + Change Log + </button> + + <br/> + <br/> + <p style="display: none">API Status: <b id="status"></b></p> + <img + id="server-status" + style="display: none; width: 0.75rem; height: 0.75rem" + src="./icons/server.svg" + alt="" /> - <path d="m8 12.5 5.1-2.9L8 6.7v5.8z" fill="#fff"/> - </svg> - <h1 style="margin-bottom: 0.75rem" title="__MSG_extensionName__"> - __MSG_extensionName__ - </h1> - <p style="color: var(--lightGrey)" title="__MSG_textDeveloper__"> - __MSG_textDeveloper__ - </p> - - <button id="link_website" title="__MSG_linkWebsite__"> - __MSG_linkWebsite__ - </button> - <button - style="margin-top: 0.3em; background: #ff0000" - id="link_donate" - title="__MSG_linkDonate__" - > - __MSG_linkDonate__ - </button> - <button id="link_discord">Discord</button> - <br/> - <button style="margin-top: 0.3rem" id="link_faq" title="__MSG_linkFAQ__"> - __MSG_linkFAQ__ - </button> - <button id="link_github">GitHub</button> - <button style="margin-top: 0.3em" id="link_help" title="__MSG_linkHelp__"> - __MSG_linkHelp__ - </button> - - <br/> - <br/> - <p style="display: none">API Status: <b id="status"></b></p> - <img - id="server-status" - style="display: none; width: 0.75rem; height: 0.75rem" - src="./icons/server.svg" - alt="" - /> - - <br/> - <br/> -</center> + + <br/> + <br/> + </center> <!-- top-right --> <button id="advancedToggle"> diff --git a/Extensions/combined/popup.js b/Extensions/combined/popup.js index 83ee423..53eb179 100644 --- a/Extensions/combined/popup.js +++ b/Extensions/combined/popup.js @@ -19,6 +19,7 @@ const config = { donate: "https://returnyoutubedislike.com/donate", faq: "https://returnyoutubedislike.com/faq", 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.donate, "link_donate"); createLink(config.links.help, "link_help"); +createLink(config.links.changelog, "link_changelog"); function createLink(url, id) { document.getElementById(id).addEventListener("click", () => { 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) => { |