From c90e32aafcd23bd646cbf2894ad6f4488006e9d1 Mon Sep 17 00:00:00 2001 From: ktg5 <42522603+ktg5@users.noreply.github.com> Date: Fri, 3 Nov 2023 16:02:16 -0700 Subject: [PATCH] possibly fixed update page not showing? --- .github/ISSUE_TEMPLATE/bug-report.md | 1 + background.js | 27 +++++++++++-------------- html/base.js | 5 +++++ html/install.html | 4 ++++ html/popup.js | 6 +++--- html/{release-note.html => update.html} | 27 ++++++++++++++++++------- setup.js | 4 +--- 7 files changed, 46 insertions(+), 28 deletions(-) rename html/{release-note.html => update.html} (86%) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index bf0ebb4..22a0e7b 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -9,6 +9,7 @@ assignees: '' **Describe the bug** A clear and concise description of what the bug is. +Make sure that you've also tested the same issue with disabling any extra extensions that may effect YouTube. **Screenshots** If applicable, add screenshots to help explain your problem. diff --git a/background.js b/background.js index 876b6c4..9349e07 100644 --- a/background.js +++ b/background.js @@ -3,22 +3,19 @@ var storage = browser.storage.sync; var extension = browser.extension; var runtime = browser.runtime; -function handleInstalled(reason) { +// On extension update +runtime.onInstalled.addListener(reason => { storage.get(['PTConfig'], function(result) { - if (Object.keys(result).length > 0 && !result.PTConfig.releaseNote) { - return; - } else if (reason == "update") { - browser.tabs.create({ - url: `./html/release-note.html` - }); - } else { - browser.tabs.create({ - url: `./html/${reason}.html` - }); + var userConfig = result.PTConfig; + // Check to see if user would like to get release notes + if (userConfig.showReleaseNotes !== false) { + // Check if previous version is not equal to current version + if (reason.previousVersion !== runtime.getManifest().version) { + // Create tab lol + browser.tabs.create({ + url: `./html/${reason.reason}.html` + }); + } } }); -} - -runtime.onInstalled.addListener(reason => { - handleInstalled(reason.reason); }); \ No newline at end of file diff --git a/html/base.js b/html/base.js index 3016f35..1daa307 100644 --- a/html/base.js +++ b/html/base.js @@ -11,6 +11,11 @@ var runtime = browser.runtime; var version = runtime.getManifest().version; setTimeout(() => { + // Add version number to page title + var pageName = document.getElementById('page-name').innerHTML; + document.title = `PlayerTube v${version} : ${pageName}`; + + // Add version number to document var slides = document.getElementsByClassName("showVersion"); for (var i = 0; i < slides.length; i++) { slides.item(i).innerHTML += "v" + version; diff --git a/html/install.html b/html/install.html index 31a8152..ca6b82e 100644 --- a/html/install.html +++ b/html/install.html @@ -2,6 +2,10 @@
+If by any chance you encounter issues when it comes to the look and feel of the YouTube player with PlayerTube & CustomTube enabled, - please make sure to set "Use current player" in the "Watch Page" - tab in the CustomTube settings. + + please make sure to set "Use current player" in the "Watch Page" + tab in the CustomTube settings. +
++ This alert will be removed sometime soon but will be accessable to + new users. +
+ +