@quanta-intellect/vessel-browser 0.1.86 → 0.1.88

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.
Files changed (2) hide show
  1. package/out/main/index.js +12 -8
  2. package/package.json +1 -1
package/out/main/index.js CHANGED
@@ -1429,8 +1429,7 @@ const VESSEL_HIGHLIGHT_CSS = `
1429
1429
  opacity: 1;
1430
1430
  }
1431
1431
  `;
1432
- async function highlightOnPage(wc, resolvedSelector, text, label, durationMs, color) {
1433
- const c = resolveColor(color);
1432
+ async function ensureHighlightStyles(wc) {
1434
1433
  await wc.executeJavaScript(`
1435
1434
  (function() {
1436
1435
  if (!document.getElementById('__vessel-highlight-styles')) {
@@ -1439,6 +1438,14 @@ async function highlightOnPage(wc, resolvedSelector, text, label, durationMs, co
1439
1438
  s.textContent = ${JSON.stringify(VESSEL_HIGHLIGHT_CSS)};
1440
1439
  document.head.appendChild(s);
1441
1440
  }
1441
+ })()
1442
+ `);
1443
+ }
1444
+ async function highlightOnPage(wc, resolvedSelector, text, label, durationMs, color) {
1445
+ const c = resolveColor(color);
1446
+ await ensureHighlightStyles(wc);
1447
+ await wc.executeJavaScript(`
1448
+ (function() {
1442
1449
  if (!window.__vesselHighlightLabelManager) {
1443
1450
  var overlap = function(a, b) {
1444
1451
  return a.left < b.right && a.right > b.left && a.top < b.bottom && a.bottom > b.top;
@@ -1643,14 +1650,9 @@ async function highlightBatchOnPage(wc, entries) {
1643
1650
  color: resolveColor(e.color)
1644
1651
  }));
1645
1652
  if (serialized.length === 0) return;
1653
+ await ensureHighlightStyles(wc);
1646
1654
  await wc.executeJavaScript(`
1647
1655
  (function() {
1648
- if (!document.getElementById('__vessel-highlight-styles')) {
1649
- var s = document.createElement('style');
1650
- s.id = '__vessel-highlight-styles';
1651
- s.textContent = ${JSON.stringify(VESSEL_HIGHLIGHT_CSS)};
1652
- document.head.appendChild(s);
1653
- }
1654
1656
  var entries = ${JSON.stringify(serialized)};
1655
1657
  ${SKIP_TAGS_JS}
1656
1658
  ${CONTENT_ROOTS_JS}
@@ -1754,6 +1756,8 @@ async function clearAllHighlightElements(wc) {
1754
1756
  el.style.removeProperty('outline');
1755
1757
  el.style.removeProperty('outline-offset');
1756
1758
  });
1759
+ var style = document.getElementById('__vessel-highlight-styles');
1760
+ if (style) style.remove();
1757
1761
  return true;
1758
1762
  })()
1759
1763
  `);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quanta-intellect/vessel-browser",
3
3
  "mcpName": "io.github.unmodeled-tyler/vessel-browser",
4
- "version": "0.1.86",
4
+ "version": "0.1.88",
5
5
  "description": "AI-native web browser runtime for autonomous agents with human supervision",
6
6
  "main": "./out/main/index.js",
7
7
  "bin": {