From ad157747ee2225c7c16dd800444a92f98f714824 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 26 Aug 2023 13:20:47 +1000 Subject: [PATCH] Customise extension settings tablimit=15 close by lru no sound --- limittabsto2.js | 4 ++-- manifest.json | 4 ++-- options.js | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/limittabsto2.js b/limittabsto2.js index 228bc8c..27f063d 100644 --- a/limittabsto2.js +++ b/limittabsto2.js @@ -48,8 +48,8 @@ // Use cleanjs.sh to remove comments before submission //******************************************** -var TABLIMIT = 2; -var DEFAULTTABLIMIT = 2; +var TABLIMIT = 15; +var DEFAULTTABLIMIT = TABLIMIT; var SOUND_LAST_PLAYED = Date.now()-2000; var limitEnabled = true; var currentonly = true; diff --git a/manifest.json b/manifest.json index de5853d..eb0e4ff 100644 --- a/manifest.json +++ b/manifest.json @@ -8,7 +8,7 @@ "description": "For my autistic son. Limits tabs to maintain system responsiveness", "manifest_version": 2, "name": "Limit Tabs", - "version": "2.2.6", + "version": "2.2.6-custom", "background": { "scripts": [ "limittabsto2.js" @@ -25,4 +25,4 @@ "32": "icons/enabled.png" } } -} \ No newline at end of file +} diff --git a/options.js b/options.js index 9432b2d..5a9c389 100644 --- a/options.js +++ b/options.js @@ -1,6 +1,6 @@ // 2.2.2 27May2021. Play the sound selected. See playsound() -var DEFAULTTABLIMIT = 2; +var DEFAULTTABLIMIT = 15; var currentonly = true; var resetmax = false; var SOUND_LAST_PLAYED = Date.now()-1000; @@ -134,7 +134,7 @@ function restoreOptions() { function setmaxtabs(result) { // console.log ("restoreOptions().setmaxtabs() called " + result.maxtabs); - document.querySelector("#maxtabs").value = result.maxtabs || 2; + document.querySelector("#maxtabs").value = result.maxtabs || DEFAULTTABLIMIT; } function setcurrentonly(result) { @@ -146,11 +146,11 @@ function restoreOptions() { } function setnewest(result) { - document.getElementById("newest").checked = result.newest || true; + document.getElementById("newest").checked = result.newest; } function setlru(result) { - document.getElementById("lru").checked = result.lru; + document.getElementById("lru").checked = result.lru || true; } function setleft(result) { @@ -162,7 +162,7 @@ function restoreOptions() { } function setbuzzer(result) { - document.getElementById("buzzer").checked = result.buzzer || true; + document.getElementById("buzzer").checked = result.buzzer; } function setdoorbell(result) { @@ -178,7 +178,7 @@ function restoreOptions() { } function setnosound(result) { - document.getElementById("nosound").checked = result.nosound; + document.getElementById("nosound").checked = result.nosound || true; } function setToggle(result) { -- 2.41.0