scriptcat icon indicating copy to clipboard operation
scriptcat copied to clipboard

后台脚本 添加 chrome.debugger.sendCommand 实现isTrusted 点击

Open ImInChina opened this issue 7 months ago • 4 comments

能加上吗?想通过background.js实现isTrusted 点击

ImInChina avatar May 11 '25 04:05 ImInChina

本来就不支持chrome.tabs,另外chrome.tabs和isTrusted点击有什么关系呢?

如果想打开新页面,可以使用 GM_openInTab

CodFrm avatar May 12 '25 03:05 CodFrm

background.js

chrome.debugger.sendCommand(
  { tabId },
  "Input.dispatchMouseEvent",
  {
    type: "mouseReleased",
    x: x,
    y: y,
    button: "left",
    clickCount: 1,
  },
  () => {
    if (callback) callback();
  }
);

这个功能

ImInChina avatar May 15 '25 04:05 ImInChina

应该是添加 chrome.debugger.sendCommand 吧,之前有尝试过添加chrome.debugger相关的API,效果感觉也不是很好,后续再考虑(主要会出现一个条条)

CodFrm avatar May 15 '25 05:05 CodFrm

嗯,我看源码里有个cat_click,写了功能暂时去掉了

---原始邮件--- 发件人: @.> 发送时间: 2025年5月15日(周四) 中午1:41 收件人: @.>; 抄送: @.@.>; 主题: Re: [scriptscat/scriptcat] 后台脚本不支持chrome.tabs (Issue #387)

CodFrm left a comment (scriptscat/scriptcat#387)

应该是添加 chrome.debugger.sendCommand 吧,之前有尝试过添加chrome.debugger相关的API,效果感觉也不是很好,后续再考虑

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ImInChina avatar May 16 '25 04:05 ImInChina