mirror of
https://git.mirrors.martin98.com/https://github.com/cilame/v_jstools
synced 2025-08-14 10:06:09 +08:00
add
This commit is contained in:
parent
9615a4062f
commit
fca47bf425
@ -2,7 +2,7 @@
|
|||||||
"name": "v_jstools",
|
"name": "v_jstools",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "v_jstools js hook工具",
|
"description": "v_jstools js hook工具",
|
||||||
"permissions": ["storage", "activeTab", "tabs", "debugger", "storage", "extension", "scripting", "contextMenus"],
|
"permissions": ["storage", "unlimitedStorage", "activeTab", "tabs", "debugger", "storage", "contextMenus"],
|
||||||
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
|
||||||
"browser_action": {
|
"browser_action": {
|
||||||
"default_popup": "popup.html"
|
"default_popup": "popup.html"
|
||||||
|
90
options.js
90
options.js
File diff suppressed because one or more lines are too long
6
popup.js
6
popup.js
@ -10,7 +10,7 @@ function sendMessageToContentScript(message, callback){
|
|||||||
}
|
}
|
||||||
|
|
||||||
document.querySelectorAll("input").forEach(function(v){
|
document.querySelectorAll("input").forEach(function(v){
|
||||||
chrome.storage.sync.get([v.dataset.key], function (result) {
|
chrome.storage.local.get([v.dataset.key], function (result) {
|
||||||
if (v.type == 'checkbox'){
|
if (v.type == 'checkbox'){
|
||||||
v.checked = result[v.dataset.key];
|
v.checked = result[v.dataset.key];
|
||||||
}
|
}
|
||||||
@ -21,12 +21,12 @@ document.querySelectorAll("input").forEach(function(v){
|
|||||||
v.addEventListener("change", function (e) {
|
v.addEventListener("change", function (e) {
|
||||||
sendMessageToContentScript({[e.target.dataset.key]: e.target.checked})
|
sendMessageToContentScript({[e.target.dataset.key]: e.target.checked})
|
||||||
if (v.type == 'checkbox'){
|
if (v.type == 'checkbox'){
|
||||||
chrome.storage.sync.set({
|
chrome.storage.local.set({
|
||||||
[e.target.dataset.key]: e.target.checked
|
[e.target.dataset.key]: e.target.checked
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (v.type == 'text'){
|
if (v.type == 'text'){
|
||||||
chrome.storage.sync.set({
|
chrome.storage.local.set({
|
||||||
[e.target.dataset.key]: e.target.value
|
[e.target.dataset.key]: e.target.value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user