diff --git a/popup.html b/popup.html index 713e3f0..722d444 100644 --- a/popup.html +++ b/popup.html @@ -77,19 +77,16 @@ } /* NOTIFICATIONS */ - #notificationBanner { - display: none; + #notificationBannerContainer { background-color: #f8f3d6; font-size: .9em; line-height: 1.3em; - padding: 1em; } - #notificationBanner span { + #notificationBannerContainer span { + padding: 1em; display: none; } - #notificationBanner span[style*="display: block"] + span[style*="display: block"]{ - padding-top: .75em; - margin-top: .75em; + #notificationBannerContainer span[style*="display: block"] + span[style*="display: block"]{ border-top: 1px solid #000; } @@ -271,17 +268,19 @@ > -
- +
+ Chromium users: Due to a browser bug, this extension may stop working after an update. If this happens, try restarting your browser, turning the extension off and on via your browser's extension settings (chrome://extensions/), and/or reinstalling the extension. + Hide this message Opera users: By default, Opera will block extensions from running on search engines. - Search engine access can be enabled per-extension by going to "chrome://extensions/" + Search engine access can be enabled per-extension by going to "about:extensions" and selecting the "Allow access to search page results" option under Indie Wiki Buddy. + Hide this message
diff --git a/popup.js b/popup.js index f3398b4..57e55bb 100644 --- a/popup.js +++ b/popup.js @@ -220,19 +220,35 @@ function setBreezeWiki(setting, storeSetting = true) { } // Main function that runs on-load -document.addEventListener('DOMContentLoaded', function () { - notificationBanner = document.getElementById('notificationBanner'); - +document.addEventListener('DOMContentLoaded', function () { // If running Chromium, show warning about service worker bug if (navigator.userAgent.match(/Chrom[e|ium]/)) { - notificationBanner.style.display = 'block'; - document.getElementById('notificationBannerBug').style.display = 'block'; + const notificationBannerChromeBug = document.getElementById('notificationBannerChromeBug'); + chrome.storage.local.get({ 'hideChromeBugNote': false }, function (item) { + if (!item.hideChromeBugNote) { + notificationBannerChromeBug.style.display = 'block'; + + document.getElementById('chromeBugHideLink').addEventListener('click', function () { + chrome.storage.local.set({ 'hideChromeBugNote': true }); + notificationBannerChromeBug.style.display = 'none'; + }); + } + }); } - // If running Opera, show note about search engine acces + // If running Opera, show note about search engine access if (navigator.userAgent.match(/OPR\//)) { - notificationBanner.style.display = 'block'; - document.getElementById('notificationBannerOpera').style.display = 'block'; + const notificationBannerOpera = document.getElementById('notificationBannerOpera'); + chrome.storage.local.get({ 'hideOperaPermissionsNote': false }, function (item) { + if (!item.hideOperaPermissionsNote) { + notificationBannerOpera.style.display = 'block'; + + document.getElementById('operaPermsHideLink').addEventListener('click', function () { + chrome.storage.local.set({ 'hideOperaPermissionsNote': true }); + notificationBannerOpera.style.display = 'none'; + }); + } + }); } loadBreezeWikiOptions(); diff --git a/settings.html b/settings.html index 41b9a3f..d3fff34 100644 --- a/settings.html +++ b/settings.html @@ -106,19 +106,16 @@ } /* NOTIFICATIONS */ - #notificationBanner { - display: none; + #notificationBannerContainer { background-color: #f8f3d6; font-size: .9em; line-height: 1.3em; - padding: 1em; } - #notificationBanner span { + #notificationBannerContainer span { + padding: 1em; display: none; } - #notificationBanner span[style*="display: block"] + span[style*="display: block"]{ - padding-top: .75em; - margin-top: .75em; + #notificationBannerContainer span[style*="display: block"] + span[style*="display: block"]{ border-top: 1px solid #000; } @@ -303,17 +300,19 @@ >Source Code
-
- +
+ Chromium users: Due to a browser bug, this extension may stop working after an update. If this happens, try restarting your browser, turning the extension off and on via your browser's extension settings (chrome://extensions/), and/or reinstalling the extension. + Hide this message Opera users: By default, Opera will block extensions from running on search engines. Search engine access can be enabled per-extension by going to "about:extensions" and selecting the "Allow access to search page results" option under Indie Wiki Buddy. + Hide this message Enjoying Indie Wiki Buddy? Please leave a review! diff --git a/settings.js b/settings.js index 05b9bcf..b45b332 100644 --- a/settings.js +++ b/settings.js @@ -514,9 +514,7 @@ function setBreezeWiki(setting, storeSetting = true) { } // Main function that runs on-load -document.addEventListener('DOMContentLoaded', function () { - notificationBanner = document.getElementById('notificationBanner'); - +document.addEventListener('DOMContentLoaded', function () { // If newly installed, show initial install guide if (new URLSearchParams(window.location.search).get('newinstall')) { document.getElementById('firstInstallInfo').style.display = 'block'; @@ -524,14 +522,32 @@ document.addEventListener('DOMContentLoaded', function () { // If running Chromium, show warning about service worker bug if (navigator.userAgent.match(/Chrom[e|ium]/)) { - notificationBanner.style.display = 'block'; - document.getElementById('notificationBannerBug').style.display = 'block'; + const notificationBannerChromeBug = document.getElementById('notificationBannerChromeBug'); + chrome.storage.local.get({ 'hideChromeBugNote': false }, function (item) { + if (!item.hideChromeBugNote) { + notificationBannerChromeBug.style.display = 'block'; + + document.getElementById('chromeBugHideLink').addEventListener('click', function () { + chrome.storage.local.set({ 'hideChromeBugNote': true }); + notificationBannerChromeBug.style.display = 'none'; + }); + } + }); } - // If running Opera, show note about search engine acces + // If running Opera, show note about search engine access if (navigator.userAgent.match(/OPR\//)) { - notificationBanner.style.display = 'block'; - document.getElementById('notificationBannerOpera').style.display = 'block'; + const notificationBannerOpera = document.getElementById('notificationBannerOpera'); + chrome.storage.local.get({ 'hideOperaPermissionsNote': false }, function (item) { + if (!item.hideOperaPermissionsNote) { + notificationBannerOpera.style.display = 'block'; + + document.getElementById('operaPermsHideLink').addEventListener('click', function () { + chrome.storage.local.set({ 'hideOperaPermissionsNote': true }); + notificationBannerOpera.style.display = 'none'; + }); + } + }); } // Count number of times settings have been opened @@ -544,7 +560,9 @@ document.addEventListener('DOMContentLoaded', function () { // and if the banner hasn't been previously dismissed chrome.storage.local.get({ 'hideReviewReminder': false }, function (item) { if (!item.hideReviewReminder && ((countSettingsOpened - 1) % 5 === 0)) { - notificationBanner.style.display = 'block'; + const notificationBannerReview = document.getElementById('notificationBannerReview'); + + notificationBannerReview.style.display = 'block'; document.getElementById('notificationBannerReview').style.display = ' block'; // Disable future review reminders if user clicks links: @@ -556,7 +574,7 @@ document.addEventListener('DOMContentLoaded', function () { }); document.getElementById('reviewReminderHideLink').addEventListener('click', function () { chrome.storage.local.set({ 'hideReviewReminder': true }); - notificationBanner.style.display = 'none'; + notificationBannerReview.style.display = 'none'; }); } });