Skip to content

Commit

Permalink
Merge pull request #10 from Sav22999/new-release
Browse files Browse the repository at this point in the history
2.0.1
  • Loading branch information
Sav22999 committed Sep 12, 2023
2 parents 61dc28d + 40ef21e commit 307ea3b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Binary file modified .DS_Store
Binary file not shown.
16 changes: 15 additions & 1 deletion js/background.js
Expand Up @@ -14,6 +14,8 @@ var checkTimer = null;
var changedEdits = false;
var changedTab = false;

var minimized = false;

var activeTabId;

const linkReview = ["https://addons.mozilla.org/firefox/addon/limite/"]; //{firefox add-ons}
Expand All @@ -24,6 +26,18 @@ function loaded() {
//catch changing of tab
browser.tabs.onActivated.addListener(tabUpdated);
browser.tabs.onUpdated.addListener(tabUpdated);
browser.windows.onFocusChanged.addListener(checkLostFocus);
}

function checkLostFocus(windowId) {
if (windowId === browser.windows.WINDOW_ID_NONE) {
// The browser window is minimized or lost focus
minimized = true;
} else {
//browser has focus
minimized = false;
}
//console.log("Minimized: " + minimized);
}

function reload() {
Expand Down Expand Up @@ -289,7 +303,7 @@ function checkEverySecond(url) {
}

function increaseTime(url) {
if (enabledOrNot) {
if (enabledOrNot && !minimized) {
if (url === currentUrl) {
saveUrlToData(true, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Limite",
"version": "2.0.0.1",
"version": "2.0.1",
"author": "Saverio Morelli (Sav22999)",
"description": "Check how much time you spend on each website every day.\nOptimise your productivity, your time and your life as well.\nDon't lose precious time!",
"icons": {
Expand Down

0 comments on commit 307ea3b

Please sign in to comment.