diff --git a/_locales/en/messages.json b/_locales/en/messages.json index c373b7b3..4d47360e 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -243,5 +243,9 @@ "sourceCode": { "message": "Source Code", "description": "Used on Firefox Store Page" + }, + "noticeUpdate": { + "message": "The notice has been upgraded! If you still don't like it, hit the never show button.", + "description": "The message displayed after the notice was upgraded." } } diff --git a/content.js b/content.js index b41bf2fe..ad957aa8 100644 --- a/content.js +++ b/content.js @@ -80,13 +80,22 @@ chrome.storage.sync.get(["trackViewCount"], function(result) { //if the notice should not be shown //happens when the user click's the "Don't show notice again" button +//option renamed when new notice was made var dontShowNotice = false; -chrome.storage.sync.get(["dontShowNoticeAgain"], function(result) { +chrome.storage.sync.get(["dontShowNotice"], function(result) { let dontShowNoticeAgain = result.dontShowNoticeAgain; if (dontShowNoticeAgain != undefined) { dontShowNotice = dontShowNoticeAgain; } }); +//load the legacy option to hide the notice +var dontShowNoticeOld = false; +chrome.storage.sync.get(["dontShowNoticeAgain"], function(result) { + let dontShowNoticeAgain = result.dontShowNoticeAgain; + if (dontShowNoticeAgain != undefined) { + dontShowNoticeOld = dontShowNoticeAgain; + } +}); //get messages from the background script and the popup chrome.runtime.onMessage.addListener(messageListener); @@ -591,7 +600,15 @@ function skipToTime(v, index, sponsorTimes, openNotice) { if (openNotice) { //send out the message saying that a sponsor message was skipped if (!dontShowNotice) { - new SkipNotice(this, currentUUID); + let skipNotice = new SkipNotice(this, currentUUID); + + if (dontShowNoticeOld) { + //show why this notice is showing + skipNotice.addNoticeInfoMessage(chrome.i18n.getMessage("noticeUpdate")); + + //disable this setting + chrome.storage.sync.set({"dontShowNoticeAgain": false}); + } //auto-upvote this sponsor if (trackViewCount) { @@ -912,7 +929,7 @@ function closeAllSkipNotices(){ } function dontShowNoticeAgain() { - chrome.storage.sync.set({"dontShowNoticeAgain": true}); + chrome.storage.sync.set({"dontShowNotice": true}); dontShowNotice = true;