chrome-bridge-mcp 1.30.4 → 1.30.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Chrome Bridge for Claude Code",
4
- "version": "1.30.2",
4
+ "version": "1.30.5",
5
5
  "description": "Bridge your browser to Claude Code: 67 token-efficient web-dev automation tools over a local WebSocket. ChromeOS included.",
6
6
  "homepage_url": "https://github.com/frsorrentino/chrome-bridge",
7
7
  "minimum_chrome_version": "135",
@@ -4821,10 +4821,25 @@ async function cmdDragAndDrop({ source_selector, target_selector, mode = 'html5'
4821
4821
  const results = await chrome.scripting.executeScript({
4822
4822
  target: scriptTarget(tabId, frame_id),
4823
4823
  func: async (srcSel, tgtSel, dndMode) => {
4824
- const src = document.querySelector(srcSel);
4825
- if (!src) throw new Error(`Source element not found: ${srcSel}`);
4826
- const tgt = document.querySelector(tgtSel);
4827
- if (!tgt) throw new Error(`Target element not found: ${tgtSel}`);
4824
+ function deepQuery(sel) {
4825
+ if (!sel.includes('>>>')) return document.querySelector(sel);
4826
+ const parts = sel.split('>>>').map((s) => s.trim());
4827
+ let ctx = document;
4828
+ for (let i = 0; i < parts.length; i++) {
4829
+ const found = ctx.querySelector(parts[i]);
4830
+ if (!found) return null;
4831
+ if (i === parts.length - 1) return found;
4832
+ if (!found.shadowRoot) return null;
4833
+ ctx = found.shadowRoot;
4834
+ }
4835
+ return null;
4836
+ }
4837
+ // Un throw qui arrivava come result undefined e diventava {dragged:false}:
4838
+ // un selettore ">>>" (SyntaxError per querySelector) falliva in silenzio.
4839
+ const src = deepQuery(srcSel);
4840
+ if (!src) return { missing: 'Source', selector: srcSel };
4841
+ const tgt = deepQuery(tgtSel);
4842
+ if (!tgt) return { missing: 'Target', selector: tgtSel };
4828
4843
  src.scrollIntoView({ block: 'center', behavior: 'instant' });
4829
4844
  const sr = src.getBoundingClientRect();
4830
4845
  const tr = tgt.getBoundingClientRect();
@@ -4867,7 +4882,9 @@ async function cmdDragAndDrop({ source_selector, target_selector, mode = 'html5'
4867
4882
  args: [source_selector, target_selector, mode],
4868
4883
  world: 'MAIN',
4869
4884
  });
4870
- return results?.[0]?.result ?? { dragged: false };
4885
+ const out = elementOutcome(results, source_selector);
4886
+ if (out.missing) throw new Error(`${out.missing} element not found: ${out.selector} (no element matches; check it with query_dom)`);
4887
+ return out;
4871
4888
  }
4872
4889
 
4873
4890
  // --- clipboard ---
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "chrome-bridge-mcp",
3
3
  "mcpName": "io.github.frsorrentino/chrome-bridge",
4
- "version": "1.30.4",
4
+ "version": "1.30.5",
5
5
  "type": "module",
6
6
  "description": "Chrome Bridge by frsorrentino: MCP server that lets Claude Code borrow a tab from your own logged-in Chrome and hand it back — logins, 2FA and CAPTCHAs stay with you (handoff). 67 tools; 2.8-4.3× cheaper and up to 9.3× fewer turns than Claude in Chrome, measured; ChromeOS included.",
7
7
  "main": "server/index.js",
@@ -100,7 +100,7 @@ export const MessageType = Object.freeze({
100
100
  });
101
101
 
102
102
  // Versione
103
- export const VERSION = '1.30.4';
103
+ export const VERSION = '1.30.5';
104
104
 
105
105
  // Configurazione
106
106
  export const DEFAULT_PORT = 8765;