From 668e8549739b24c46eb329e1bb3fcce9580b91cc Mon Sep 17 00:00:00 2001
From: "YUKI \"Piro\" Hiroshi"
Date: Thu, 18 Jan 2024 04:00:22 +0900
Subject: [PATCH] Expose persistCachedTree to the UI
---
webextensions/_locales/en/messages.json | 2 ++
webextensions/_locales/ja/messages.json | 2 ++
webextensions/background/browser-action-menu.js | 5 +++++
webextensions/options/options.html | 9 ++++++++-
4 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/webextensions/_locales/en/messages.json b/webextensions/_locales/en/messages.json
index 43f356916..e0402c811 100644
--- a/webextensions/_locales/en/messages.json
+++ b/webextensions/_locales/en/messages.json
@@ -787,6 +787,8 @@
"config_staticARIALabel_description": { "message": "*Please try checking this if your speech recognition system misses tab elements after some tab operations." },
"config_useCachedTree_label": { "message": "Optimize tree restoration with cache" },
"config_useCachedTree_description": { "message": "*Please try unchecking and re-checking this to refresh the cache, when the behavior around tree is unstable." },
+ "config_persistCachedTree_label": { "message": "Persist tree cache" },
+ "config_persistCachedTree_description": { "message": "*Initialization process at the browser startup may be optimized, but it will broat the size of browser's session file and increase disk I/O." },
"config_acceleratedTabCreation_label": { "message": "Accelerate operations around newly opened tabs (*NOTE: You'll see unstable behavior around tabs.)" },
"config_maximumAcceptableDelayForTabDuplication_before": { "message": "Abort tab duplication when it takes" },
"config_maximumAcceptableDelayForTabDuplication_after": { "message": "milliseconds or more." },
diff --git a/webextensions/_locales/ja/messages.json b/webextensions/_locales/ja/messages.json
index cedc19e86..6d7bf2ef2 100644
--- a/webextensions/_locales/ja/messages.json
+++ b/webextensions/_locales/ja/messages.json
@@ -784,6 +784,8 @@
"config_staticARIALabel_description": { "message": "※何らかのタブ操作のあとで音声認識システムがタブ要素を見失ってしまう場合、このチェックをONにしてください。" },
"config_useCachedTree_label": { "message": "キャッシュを使ってツリーの初期化を高速化する" },
"config_useCachedTree_description": { "message": "※キャッシュの不整合で動作が不安定になっている場合、このチェックをOFFにして再度ONにすることでキャッシュが刷新され状況が改善するかもしれません。" },
+ "config_persistCachedTree_label": { "message": "キャッシュを永続化する" },
+ "config_persistCachedTree_description": { "message": "※ブラウザー起動時やアドオン更新時などの初期化処理を短縮できますが、ブラウザーのセッションファイルが肥大化しディスクI/Oが増加します" },
"config_acceleratedTabCreation_label": { "message": "新しいタブが開かれた時の処理を高速化する(※動作が不安定になります)" },
"config_maximumAcceptableDelayForTabDuplication_before": { "message": "\u200b" },
"config_maximumAcceptableDelayForTabDuplication_after": { "message": "ミリ秒以内にタブの複製を完了できなかった場合は処理を中断する" },
diff --git a/webextensions/background/browser-action-menu.js b/webextensions/background/browser-action-menu.js
index ef21884e5..7edc03b56 100644
--- a/webextensions/background/browser-action-menu.js
+++ b/webextensions/background/browser-action-menu.js
@@ -1911,6 +1911,11 @@ const mItems = [
key: 'useCachedTree',
type: 'checkbox'
},
+ {
+ title: indent(2) + browser.i18n.getMessage('config_persistCachedTree_label'),
+ key: 'persistCachedTree',
+ type: 'checkbox'
+ },
{
title: indent() + browser.i18n.getMessage('config_supportTabsMultiselect_label'),
key: 'supportTabsMultiselect',
diff --git a/webextensions/options/options.html b/webextensions/options/options.html
index 10261bc26..04215f60a 100644
--- a/webextensions/options/options.html
+++ b/webextensions/options/options.html
@@ -1239,7 +1239,14 @@ __MSG_config_advanced_caption__
>
__MSG_config_useCachedTree_label__
- __MSG_config_useCachedTree_description__
+
+
__MSG_config_useCachedTree_description__
+
+
__MSG_config_persistCachedTree_description__
+