Add notice for Chromium users regarding update bug

pull/173/head
Kevin Payravi 2023-07-01 01:33:11 -05:00 committed by GitHub
parent 32bc047419
commit 2f2c67b119
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 76 additions and 13 deletions

View File

@ -71,6 +71,23 @@
width: fit-content;
}
/* NOTIFICATIONS */
#notificationBanner {
display: none;
background-color: #f8f3d6;
font-size: .9em;
line-height: 1.3em;
padding: 1em;
}
#notificationBanner span {
display: none;
}
#notificationBanner span[style*="display: block"] + span[style*="display: block"]{
padding-top: .75em;
margin-top: .75em;
border-top: 1px solid #000;
}
/* POWER TOGGLE */
#power {
cursor: pointer;
@ -237,6 +254,14 @@
>
</div>
</div>
<div id="notificationBanner">
<span id="notificationBannerBug">
Chromium users: Due to a <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1271154" target="_blank">browser bug</a>,
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.
</span>
</div>
</body>
<script type="text/javascript" src="popup.js"></script>
</html>

View File

@ -219,6 +219,16 @@ function setBreezeWiki(setting, storeSetting = true) {
// Main function that runs on-load
document.addEventListener('DOMContentLoaded', function () {
notificationBanner = document.getElementById('notificationBanner');
// 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';
}
loadBreezeWikiOptions();
// Listener for settings page in new tab:
document.getElementById('openSettings').addEventListener('click', function () {
chrome.tabs.create({'url': chrome.runtime.getURL('settings.html')});

View File

@ -106,6 +106,14 @@
line-height: 1.3em;
padding: 1em;
}
#notificationBanner span {
display: none;
}
#notificationBanner span[style*="display: block"] + span[style*="display: block"]{
padding-top: .75em;
margin-top: .75em;
border-top: 1px solid #000;
}
/* GLOBAL SETTINGS SECTION */
.options {
@ -289,15 +297,23 @@
>
</div>
<div id="notificationBanner">
Enjoying Indie Wiki Buddy? Please leave a review!
<br />
<a id="reviewReminderChromeLink" target="_blank" href="https://chrome.google.com/webstore/detail/indie-wiki-buddy/fkagelmloambgokoeokbpihmgpkbgbfm">Chrome</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a id="reviewReminderFirefoxLink" target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/indie-wiki-buddy/">Firefox</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a id="reviewReminderHideLink" href="#">Hide this message</a>
<br /><br />
Having issues or ideas for improvement? Please <a target="_blank" href="https://getindie.wiki/#contact">contact me</a>!
<span id="notificationBannerBug">
Chromium users: Due to a <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1271154" target="_blank">browser bug</a>,
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.
</span>
<span id="notificationBannerReview">
Enjoying Indie Wiki Buddy? Please leave a review!
<br />
<a id="reviewReminderChromeLink" target="_blank" href="https://chrome.google.com/webstore/detail/indie-wiki-buddy/fkagelmloambgokoeokbpihmgpkbgbfm">Chrome</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a id="reviewReminderFirefoxLink" target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/indie-wiki-buddy/">Firefox</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a id="reviewReminderHideLink" href="#">Hide this message</a>
<br /><br />
Having issues or ideas for improvement? Please <a target="_blank" href="https://getindie.wiki/#contact">contact me</a>!
</span>
</div>
<div id="content">
<h2>Global settings</h2>

View File

@ -507,6 +507,17 @@ function setBreezeWiki(setting, storeSetting = true) {
// Main function that runs on-load
document.addEventListener('DOMContentLoaded', function () {
notificationBanner = document.getElementById('notificationBanner');
// If running Chromium, show warning about service worker bug
console.log('wooo');
if (navigator.userAgent.match(/Chrom[e|ium]/)) {
console.log('weee');
notificationBanner.style.display = 'block';
document.getElementById('notificationBannerBug').style.display = 'block';
}
// Count number of times settings have been opened
// Purposefully using local storage instead of sync
chrome.storage.local.get({ 'countSettingsOpened': 0 }, function (item) {
@ -517,19 +528,20 @@ 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)) {
document.getElementById('notificationBanner').style.display = 'block';
notificationBanner.style.display = 'block';
document.getElementById('notificationBannerReview').style.display = ' block';
// Disable future review reminders if user clicks links:
document.getElementById('reviewReminderChromeLink').addEventListener('click', function () {
chrome.storage.local.set({ 'hideReviewReminder': true });
});
});
document.getElementById('reviewReminderFirefoxLink').addEventListener('click', function () {
chrome.storage.local.set({ 'hideReviewReminder': true });
});
document.getElementById('reviewReminderHideLink').addEventListener('click', function () {
chrome.storage.local.set({ 'hideReviewReminder': true });
document.getElementById('notificationBanner').style.display = 'none';
});
notificationBanner.style.display = 'none';
});
}
});
});