diff --git a/background.js b/background.js index 4ae0024..0534202 100644 --- a/background.js +++ b/background.js @@ -10,7 +10,7 @@ chrome.contextMenus.create({ - title: "打开配置页面", + title: "打开 v_jstools 配置页面", contexts: ['all'], onclick: function(){ chrome.tabs.create({ diff --git a/options.html b/options.html index 4b41bb6..6a3c345 100644 --- a/options.html +++ b/options.html @@ -21,6 +21,75 @@
+
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ 此处的两个配置会影响后面的全部挂钩操作 +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
@@ -29,7 +98,6 @@ -
diff --git a/options.js b/options.js index cc5cc21..dc1cae9 100644 --- a/options.js +++ b/options.js @@ -61,7 +61,7 @@ var funcs = [['FinalizationRegistry', 'register'],['FinalizationRegistry', 'unre function _mk_html(input, clsname){ var div = document.getElementById(clsname) div.innerHTML += ` - + ` var htmls = [] var keys = [] @@ -86,6 +86,21 @@ document.querySelectorAll("input").forEach(function(v){ if (v.type == 'checkbox'){ v.checked = result[v.dataset.key]; } + if (v.type == 'text'){ + v.value = result[v.dataset.key] || ''; + } + }) + v.addEventListener("change", function (e) { + if (v.type == 'checkbox'){ + chrome.storage.local.set({ + [e.target.dataset.key]: e.target.checked + }) + } + if (v.type == 'text'){ + chrome.storage.local.set({ + [e.target.dataset.key]: e.target.value + }) + } }) }) diff --git a/popup.html b/popup.html index b55eba4..e0de1bc 100644 --- a/popup.html +++ b/popup.html @@ -5,75 +5,99 @@ Document + + + + - - -
- -
- -
- -
- -
- -
-
-
- 此处的两个配置会影响后面的全部挂钩操作 -
-
- -
-
- -
-
- -
+ + +
是否挂钩总开关
+
+
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- -
- + \ No newline at end of file