@zibby/mcp-browser 0.1.8 → 0.1.9
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.
- package/dist/package.json +5 -6
- package/dist/stable-id-inject.js +1 -1
- package/package.json +2 -3
package/dist/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zibby/mcp-browser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Wrapper for @playwright/mcp with stable ID support and event recording",
|
|
5
5
|
"type": "commonjs",
|
|
6
|
-
"main": "bin/mcp-browser-zibby.js",
|
|
6
|
+
"main": "dist/bin/mcp-browser-zibby.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"mcp-browser-zibby": "bin/mcp-browser-zibby.js"
|
|
8
|
+
"mcp-browser-zibby": "dist/bin/mcp-browser-zibby.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
|
-
"
|
|
12
|
-
"src/",
|
|
11
|
+
"dist/",
|
|
13
12
|
"README.md",
|
|
14
13
|
"LICENSE"
|
|
15
14
|
],
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
},
|
|
42
41
|
"license": "MIT",
|
|
43
42
|
"author": "Zibby",
|
|
44
|
-
"homepage": "https://zibby.
|
|
43
|
+
"homepage": "https://zibby.dev",
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"esbuild": "^0.28.0"
|
|
47
46
|
}
|
package/dist/stable-id-inject.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){if(window.__zibbyInitialized)return;window.__zibbyInitialized=!0;function y(t){if(t.getAttribute("aria-label"))return t.getAttribute("aria-label").trim();
|
|
1
|
+
(function(){if(window.__zibbyInitialized)return;window.__zibbyInitialized=!0;function y(t){if(t.getAttribute("aria-label"))return t.getAttribute("aria-label").trim();let e=t.getAttribute("aria-labelledby");if(e){let n=document.getElementById(e);if(n)return n.textContent.trim()}if(t.id){let n=document.querySelector(`label[for="${t.id}"]`);if(n)return n.textContent.trim()}let o=t.closest("label");if(o){let n=o.cloneNode(!0);n.querySelectorAll("input, select, textarea").forEach(c=>c.remove());let a=n.textContent.trim();if(a)return a}if(t.placeholder)return t.placeholder;let r=t.tagName.toLowerCase();return r==="button"||r==="a"||t.getAttribute("role")==="button"?(t.textContent||"").trim().slice(0,50):t.title?t.title:r==="input"&&(t.type==="submit"||t.type==="button")&&t.value||""}function p(t){let e=[],o=t.closest("form");if(o)if(o.id)e.push("form#"+o.id);else if(o.name)e.push("form[name="+o.name+"]");else if(o.action)try{let i=new URL(o.action,window.location.origin).pathname;e.push("form[action="+i+"]")}catch{e.push("form[action="+o.getAttribute("action")+"]")}else{let i=document.querySelectorAll("form"),s=Array.from(i).indexOf(o);e.push("form:nth("+s+")")}let r=t.closest('header, nav, main, footer, aside, [role="banner"], [role="navigation"], [role="main"], [role="contentinfo"]');if(r){let i=r.tagName.toLowerCase(),s=r.getAttribute("role");e.push(s||i)}let n=t.closest('section, article, [role="region"]');if(n){let i=n.querySelector("h1, h2, h3, h4, h5, h6");i&&e.push("section:"+i.textContent.trim().slice(0,30))}let a=t.closest("fieldset");if(a){let i=a.querySelector("legend");i&&e.push("fieldset:"+i.textContent.trim())}let c=t.closest('dialog, [role="dialog"], [role="alertdialog"]');if(c){let i=c.querySelector('[role="heading"], h1, h2, h3');i?e.push("dialog:"+i.textContent.trim().slice(0,30)):e.push("dialog")}return e.join("/")}function f(t){let e=t.tagName.toLowerCase(),o=t.id||"",r=t.name||"",n=t.type||"",a=t.getAttribute("role")||"",c="";if(t.href)try{c=new URL(t.href,window.location.origin).pathname.slice(0,50)}catch{c=t.getAttribute("href")?.slice(0,50)||""}let i=y(t).slice(0,50).replace(/\s+/g," "),s=p(t),h=[e,o,r,n,a,c,i,s].join("|"),l=5381;for(let b=0;b<h.length;b++)l=(l<<5)+l^h.charCodeAt(b);return"zibby-"+(l>>>0).toString(36)}function m(){if(!document.body)return;let t=["button","a","input","select","textarea","label[for]",'[role="button"]','[role="link"]','[role="textbox"]','[role="checkbox"]','[role="radio"]','[role="combobox"]','[role="menuitem"]','[role="tab"]','[role="option"]','[role="switch"]','[role="slider"]',"[onclick]","[data-action]"].join(", "),e=new Map;try{document.querySelectorAll(t).forEach(o=>{let r=window.getComputedStyle(o);if(r.display==="none"||r.visibility==="hidden")return;let n=f(o),a=n,c=e.get(a)||0;c>0&&(n=a+"-"+c),e.set(a,c+1),o.setAttribute("data-zibby-id",n)})}catch(o){console.error("[Zibby] Error injecting stable IDs:",o)}}function g(){if(!document.body&&document.readyState==="loading"){document.addEventListener("DOMContentLoaded",g);return}m();let t=new MutationObserver(()=>{requestAnimationFrame(m)});document.body&&t.observe(document.body,{childList:!0,subtree:!0})}window.__zibbyGetStableId=function(t){return t?.getAttribute("data-zibby-id")||null};function w(){let t=window.location.hostname.split(".");return t.length>=2?"."+t.slice(-2).join("."):window.location.hostname}Object.defineProperty(window,"__zibbyLastStableId",{get:function(){let t=document.cookie.match(/(?:^|; )__zibbyLastStableId=([^;]*)/);return t?decodeURIComponent(t[1]):null},set:function(t){if(t){let e=w();document.cookie=`__zibbyLastStableId=${encodeURIComponent(t)}; domain=${e}; path=/; max-age=3600; SameSite=Lax`}}});function d(t){let e=t.closest("[data-zibby-id]");if(e)return e;let o=t.closest("label");if(o){if(o.htmlFor){let a=document.getElementById(o.htmlFor);if(a?.getAttribute("data-zibby-id"))return a}let n=o.querySelector('input, select, textarea, [role="checkbox"], [role="radio"]');if(n?.getAttribute("data-zibby-id"))return n}let r=t.closest('[class*="select"], [class*="dropdown"], [class*="checkbox"], [class*="radio"]');if(r){let n=r.querySelector("[data-zibby-id]");if(n)return n}return null}function u(t){if(!t)return null;let e=t.getAttribute("data-zibby-id");if(e)return e;let o=f(t);return t.setAttribute("data-zibby-id",o),o}document.addEventListener("click",t=>{let e=d(t.target);!e&&t.target.matches('button, a, input, select, textarea, [role="button"], [onclick]')&&(e=t.target),e&&(window.__zibbyLastStableId=u(e))},!0),document.addEventListener("focusin",t=>{let e=d(t.target);!e&&t.target.matches('input, select, textarea, [role="textbox"], [role="combobox"]')&&(e=t.target),e&&(window.__zibbyLastStableId=u(e))},!0),document.addEventListener("change",t=>{let e=d(t.target);e||(e=t.target),e&&(window.__zibbyLastStableId=u(e))},!0),g()})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zibby/mcp-browser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Wrapper for @playwright/mcp with stable ID support and event recording",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/bin/mcp-browser-zibby.js",
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"mcp-browser-zibby": "dist/bin/mcp-browser-zibby.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
|
-
"dist/bin/",
|
|
12
11
|
"dist/",
|
|
13
12
|
"README.md",
|
|
14
13
|
"LICENSE"
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
},
|
|
42
41
|
"license": "MIT",
|
|
43
42
|
"author": "Zibby",
|
|
44
|
-
"homepage": "https://zibby.
|
|
43
|
+
"homepage": "https://zibby.dev",
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"esbuild": "^0.28.0"
|
|
47
46
|
}
|