Skip to content

Commit

Permalink
additional fixes for manifest v3 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
markovic-nikola committed Dec 7, 2023
1 parent 36aad4f commit 9ae2199
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
12 changes: 6 additions & 6 deletions chrome/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var Timer = function() {
that.setTime(that.time);
}, 1000);
that.setRunning(true);
chrome.browserAction.setBadgeBackgroundColor({color: '#2980b9'});
chrome.action.setBadgeBackgroundColor({color: '#2980b9'});
that.updateIdle();
},

Expand All @@ -40,7 +40,7 @@ var Timer = function() {
});

that.saveTime(that.time);
chrome.browserAction.setBadgeText({text: (that.time > 0 ? that.formatCurrentHumanTime() : '')});
chrome.action.setBadgeText({text: (that.time > 0 ? that.formatCurrentHumanTime() : '')});
that.checkTimerLimitReached();

},
Expand Down Expand Up @@ -93,16 +93,16 @@ var Timer = function() {
clearInterval(that.interval);
that.setRunning(false);
that.update();
chrome.browserAction.setBadgeBackgroundColor({color: '#d35400'});
chrome.action.setBadgeBackgroundColor({color: '#d35400'});
},

this.stop = function() {
that.pause();
that.setTime(0);
that.limitReached = false;
that.checkTimerLimitReached();
chrome.browserAction.setBadgeBackgroundColor({color: '#e74c3c'});
chrome.browserAction.setBadgeText({text: ''});
chrome.action.setBadgeBackgroundColor({color: '#e74c3c'});
chrome.action.setBadgeText({text: ''});
chrome.storage.sync.remove('time');
},

Expand Down Expand Up @@ -244,7 +244,7 @@ var Timer = function() {
}
});

chrome.browserAction.setBadgeBackgroundColor({color: '#e74c3c'});
chrome.action.setBadgeBackgroundColor({color: '#e74c3c'});
this.syncInitialTime();
}

Expand Down
7 changes: 2 additions & 5 deletions chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"storage",
"idle"
],
"browser_action": {
"action": {
"default_icon": {
"16": "assets/icon_16.png",
"32": "assets/icon_32.png",
Expand All @@ -25,10 +25,7 @@
"default_popup": "popup/popup.html"
},
"background": {
"scripts": [
"background.js"
],
"persistent": false
"service_worker": "background.js"
},
"offline_enabled": true,
"options_page": "options/options.html",
Expand Down

0 comments on commit 9ae2199

Please sign in to comment.