Skip to content

Commit

Permalink
Fix #1582 - Add logic to not show news items to browsers that do no s…
Browse files Browse the repository at this point in the history
…upport that feature
  • Loading branch information
maxxcrawford committed Mar 1, 2022
1 parent a01b7da commit 4cc7397
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion static/js/whatsnew.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
const footer = document.querySelector(".js-whatsnew-footer");
const backButton = footer.querySelector("button");
const profileId = popup.dataset.profileId;
const browserIsFirefox = /firefox|FxiOS/i.test(navigator.userAgent);

enableEntry("size-limit");
if (popup.dataset.hasPremium === "True") {
Expand All @@ -14,7 +15,8 @@
// Wait until the add-on has initialised:
setTimeout(() => {
const isAddonPresent = document.querySelector("firefox-private-relay-addon")?.dataset.addonInstalled === "true";
if (isAddonPresent) {
// Only show sign-back in news item if the user is in Firefox AND has the add-on installed
if (isAddonPresent && browserIsFirefox) {
enableEntry("sign-back-in")
}
}, 500)
Expand Down

0 comments on commit 4cc7397

Please sign in to comment.