mirror of
https://git.mirrors.martin98.com/https://github.com/cilame/v_jstools
synced 2025-08-16 12:15:53 +08:00
add
This commit is contained in:
parent
78d2333d07
commit
b1686aa0f5
@ -83,3 +83,23 @@ function AttachDebugger() {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// var currtabid;
|
||||||
|
// var currdomain;
|
||||||
|
// chrome.extension.onMessage.addListener(function (req, sender, sendResponse){
|
||||||
|
// if (req.getcookie){
|
||||||
|
// currtabid = sender.tab.id
|
||||||
|
// currdomain = req.domain
|
||||||
|
// sendResponse({})
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// chrome.cookies.onChanged.addListener(function(info){
|
||||||
|
// if (currtabid){
|
||||||
|
// chrome.cookies.getAll({domain: currdomain}, function(cookie){
|
||||||
|
// var cookies = []
|
||||||
|
// for (var i = 0; i < cookie.length; i++) {
|
||||||
|
// cookies.push(cookie[i])
|
||||||
|
// }
|
||||||
|
// chrome.tabs.sendMessage(currtabid, {action: {type:'getcookie', info: cookies}}, function(){})
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
33
inject.js
33
inject.js
@ -1335,17 +1335,22 @@ chrome.storage.local.get(hookers, function (result) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
chrome.extension.onMessage.addListener(function(msg, sender, sendResponse) {
|
// chrome.extension.onMessage.addListener(function(msg, sender, sendResponse) {
|
||||||
if (msg.action.type == 'error'){
|
// if (msg.action.type == 'error'){
|
||||||
inject_script(`console.error(${JSON.stringify(msg.action.info)})`)
|
// inject_script(`console.error(${JSON.stringify(msg.action.info)})`)
|
||||||
}
|
// }
|
||||||
if (msg.action.type == 'addlistener'){
|
// if (msg.action.type == 'addlistener'){
|
||||||
inject_script(`try{v_log_env()}catch(e){debugger;alert('请打开调试总开关,同时将dom挂钩全部选中后,再刷新页面点击代码生成按钮。')}`)
|
// inject_script(`try{v_log_env()}catch(e){debugger;alert('请打开调试总开关,同时将dom挂钩全部选中后,再刷新页面点击代码生成按钮。')}`)
|
||||||
}
|
// }
|
||||||
if (msg.action.type == 'logtoggle'){
|
// if (msg.action.type == 'logtoggle'){
|
||||||
inject_script(`globalConfig.logtogglefunc({key:'w',altKey:true})`)
|
// inject_script(`globalConfig.logtogglefunc({key:'w',altKey:true})`)
|
||||||
}
|
// }
|
||||||
if (msg.action.type == 'alerterror'){
|
// if (msg.action.type == 'alerterror'){
|
||||||
inject_script(`alert(${JSON.stringify(msg.action.info)})`)
|
// inject_script(`alert(${JSON.stringify(msg.action.info)})`)
|
||||||
}
|
// }
|
||||||
});
|
// if (msg.action.type == 'getcookie'){
|
||||||
|
// inject_script('window.vilame_setter='+JSON.stringify(msg.action.info))
|
||||||
|
// }
|
||||||
|
// sendResponse({})
|
||||||
|
// });
|
||||||
|
// chrome.extension.sendMessage({getcookie:true, domain:document.domain}, function(res){})
|
@ -35,7 +35,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", "unlimitedStorage", "activeTab", "tabs", "debugger", "storage", "contextMenus", "cookies"],
|
"permissions": ["storage", "unlimitedStorage", "activeTab", "tabs", "debugger", "storage", "contextMenus", "http://*/*", "https://*/*", "cookies"],
|
||||||
"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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user