pawbrowse 0.6.0 → 0.6.1

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.
@@ -470,7 +470,9 @@ const SNAPSHOT = `(function(seed, opts){
470
470
  if(['button','submit','reset'].indexOf(e.type)>=0 && e.value) return e.value;
471
471
  if(e.getAttribute('alt')) return e.getAttribute('alt');
472
472
  // Visible descendants only: display:none / hidden children (tooltips, menus) must not leak in.
473
- var txt = (tag==='INPUT'||tag==='SELECT'||tag==='TEXTAREA') ? '' : [].map.call(e.childNodes,function(n){ return n.nodeType===3 ? n.textContent : (n.nodeType===1 && visible(n) ? name(n,seen) : ''); }).join(' ').trim();
473
+ // A rich-text editor's text is its VALUE, never its name (else typing into it renames it and
474
+ // its ref is refused on the next action).
475
+ var txt = (tag==='INPUT'||tag==='SELECT'||tag==='TEXTAREA'||e.isContentEditable) ? '' : [].map.call(e.childNodes,function(n){ return n.nodeType===3 ? n.textContent : (n.nodeType===1 && visible(n) ? name(n,seen) : ''); }).join(' ').trim();
474
476
  if(txt) return txt;
475
477
  return e.getAttribute('title')||e.getAttribute('placeholder')||e.getAttribute('aria-placeholder')||'';
476
478
  }
@@ -859,7 +861,7 @@ function formatTable(snap) {
859
861
  // A page signature to detect whether an action actually changed the page. Includes per-input
860
862
  // value/checked/selectedIndex so fills, toggles, and selects register as changes (password
861
863
  // values excluded).
862
- const SIG = `JSON.stringify([location.href, document.title, [].map.call(document.querySelectorAll('input,textarea,select'),function(e){return e.type==='password'?'':(String(e.value)+'~'+(e.checked?1:0)+'~'+(e.selectedIndex==null?'':e.selectedIndex));}).join('|'), document.querySelectorAll('a,button,input,select,textarea,summary,[role]').length])`;
864
+ const SIG = `JSON.stringify([location.href, document.title, document.body ? document.body.textContent.length : 0, [].map.call(document.querySelectorAll('input,textarea,select'),function(e){return e.type==='password'?'':(String(e.value)+'~'+(e.checked?1:0)+'~'+(e.selectedIndex==null?'':e.selectedIndex));}).join('|'), document.querySelectorAll('a,button,input,select,textarea,summary,[role]').length])`;
863
865
 
864
866
  // Retry through transient "document is navigating" states so a snapshot taken
865
867
  // during a transition settles instead of failing.
@@ -1905,7 +1907,7 @@ async function handleCommand(cmd, args, token, session) {
1905
1907
  // the caller think they failed and retry them.
1906
1908
  let table;
1907
1909
  try { table = await observe(tabId); } catch { table = null; }
1908
- const changed = before == null || after == null || before !== after || table == null || seen == null || tableBody(table) !== seen;
1910
+ const changed = before == null || after == null || before !== after || table == null || seen == null || tableBody(table) !== seen || dialogLog.has(tabId);
1909
1911
  const note = changed ? 'page changed' : 'page did NOT change (if you expected an effect, the action may not have worked — try a different target)';
1910
1912
  if (table == null) {
1911
1913
  return `ran ${ops.length} op(s) [${note}]:\n${logLines.join('\n')}\n${takeDialogLog(tabId)}\n(ops executed; the page is navigating and could not be read yet — call browser_observe next. Do NOT re-run these ops.)`;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "PawBrowse",
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "description": "Let your AI agent (Claude Code) drive your real Chrome. Fast element-table control. Open source, no keys.",
6
6
  "minimum_chrome_version": "125",
7
7
  "permissions": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pawbrowse",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Let Claude Code drive your real, logged-in Chrome. A zero-dependency MCP server + a Chrome MV3 extension that uses element-table perception over CDP. The calling agent is the policy: no second model, no API keys, page snapshots never leave for a third party.",
5
5
  "type": "module",
6
6
  "bin": {