mirror of
https://git.mirrors.martin98.com/https://github.com/cilame/v_jstools
synced 2025-08-13 22:25:52 +08:00
add
This commit is contained in:
parent
b673866848
commit
47ffbd755b
@ -313,4 +313,13 @@ function get_html(url){
|
||||
head.append(insert_script)
|
||||
}
|
||||
return $.html()
|
||||
}
|
||||
}
|
||||
|
||||
chrome.storage.local.get(['config-hook-global'], function(e){
|
||||
chrome.browserAction.setBadgeBackgroundColor({color: '#BC1717'});
|
||||
if (e['config-hook-global']){
|
||||
chrome.browserAction.setBadgeText({text: 'v'});
|
||||
}else{
|
||||
chrome.browserAction.setBadgeText({text: ''});
|
||||
}
|
||||
})
|
@ -444,6 +444,12 @@ document.querySelectorAll("input").forEach(function(v){
|
||||
})
|
||||
v.addEventListener("change", function (e) {
|
||||
if (v.type == 'checkbox'){
|
||||
// console.log(e.target.dataset.key, e.target.checked)
|
||||
if (e.target.dataset.key == 'config-hook-global' && e.target.checked){
|
||||
chrome.browserAction.setBadgeText({text: 'v'});
|
||||
}else{
|
||||
chrome.browserAction.setBadgeText({text: ''});
|
||||
}
|
||||
chrome.storage.local.set({
|
||||
[e.target.dataset.key]: e.target.checked
|
||||
})
|
||||
|
@ -124,7 +124,7 @@
|
||||
<label class="switch">
|
||||
<input type="checkbox" data-key="config-hook-new-tab"><div class="slider"></div>
|
||||
</label>
|
||||
<div style="float: right; padding: 10px">禁用覆盖newTab页</div>
|
||||
<div style="float: right; padding: 10px">启用覆盖newTab页</div>
|
||||
<label class="switch">
|
||||
<input type="checkbox" data-key="config-myinject_toggle"><div class="slider"></div>
|
||||
</label>
|
||||
|
6
popup.js
6
popup.js
@ -9,6 +9,12 @@ document.querySelectorAll("input").forEach(function(v){
|
||||
})
|
||||
v.addEventListener("change", function (e) {
|
||||
if (v.type == 'checkbox'){
|
||||
// console.log(e.target.dataset.key, e.target.checked)
|
||||
if (e.target.dataset.key == 'config-hook-global' && e.target.checked){
|
||||
chrome.browserAction.setBadgeText({text: 'v'});
|
||||
}else{
|
||||
chrome.browserAction.setBadgeText({text: ''});
|
||||
}
|
||||
chrome.storage.local.set({
|
||||
[e.target.dataset.key]: e.target.checked
|
||||
})
|
||||
|
@ -1,5 +1,5 @@
|
||||
chrome.storage.local.get(["config-hook-new-tab"], function(e) {
|
||||
if(e['config-hook-new-tab']) {
|
||||
if(!e['config-hook-new-tab']) {
|
||||
chrome.tabs.update({ url: "chrome-search://local-ntp/local-ntp.html" })
|
||||
}else{
|
||||
runall()
|
||||
|
Loading…
x
Reference in New Issue
Block a user