mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-15 07:05:21 +08:00
重构浏览器自动化功能:执行脚本,获取地址等操作,需指定标签页,新增标签页截图功能
This commit is contained in:
@@ -116,8 +116,10 @@ const getOptimalSelector = () => {
|
||||
`;
|
||||
};
|
||||
|
||||
const getSelector = async () => {
|
||||
return await executeScript(`
|
||||
const getSelector = async (tab) => {
|
||||
return await executeScript(
|
||||
tab,
|
||||
`
|
||||
return new Promise((resolve) => {
|
||||
// 创建高亮元素
|
||||
const highlight = document.createElement('div');
|
||||
@@ -172,7 +174,8 @@ const getSelector = async () => {
|
||||
document.addEventListener('mousemove', handleMouseMove);
|
||||
document.addEventListener('click', handleClick, true);
|
||||
});
|
||||
`);
|
||||
`
|
||||
);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user