Skip to content

Commit 846107a

Browse files
authored
Merge pull request #43 from SentienceAPI/sync-extension-v1.0.9
Sync Extension: v1.0.9
2 parents cbf32fb + f806803 commit 846107a

File tree

4 files changed

+66
-48
lines changed

4 files changed

+66
-48
lines changed

sentience/extension/injected_api.js

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@
6969
return '';
7070
}
7171

72+
// --- HELPER: Safe String Converter ---
73+
// Converts any value (including SVGAnimatedString) to a plain string or null
74+
// This prevents WASM deserialization errors on SVG elements
75+
function toSafeString(value) {
76+
if (value === null || value === undefined) return null;
77+
if (typeof value === 'string') return value;
78+
// Handle SVGAnimatedString (has baseVal property)
79+
if (value && typeof value === 'object' && 'baseVal' in value) {
80+
return typeof value.baseVal === 'string' ? value.baseVal : null;
81+
}
82+
// Convert other types to string
83+
try {
84+
return String(value);
85+
} catch (e) {
86+
return null;
87+
}
88+
}
89+
7290
// --- HELPER: Viewport Check (NEW) ---
7391
function isInViewport(rect) {
7492
return (
@@ -358,26 +376,26 @@
358376
tag: el.tagName.toLowerCase(),
359377
rect: { x: rect.x, y: rect.y, width: rect.width, height: rect.height },
360378
styles: {
361-
display: style.display,
362-
visibility: style.visibility,
363-
opacity: style.opacity,
364-
z_index: String(style.zIndex || "auto"), // Force string conversion
365-
bg_color: style.backgroundColor,
366-
color: style.color,
367-
cursor: style.cursor,
368-
font_weight: String(style.fontWeight), // Force string conversion
369-
font_size: style.fontSize
379+
display: toSafeString(style.display),
380+
visibility: toSafeString(style.visibility),
381+
opacity: toSafeString(style.opacity),
382+
z_index: toSafeString(style.zIndex || "auto"),
383+
bg_color: toSafeString(style.backgroundColor),
384+
color: toSafeString(style.color),
385+
cursor: toSafeString(style.cursor),
386+
font_weight: toSafeString(style.fontWeight),
387+
font_size: toSafeString(style.fontSize)
370388
},
371389
attributes: {
372-
role: el.getAttribute('role'),
373-
type_: el.getAttribute('type'),
374-
aria_label: el.getAttribute('aria-label'),
375-
// Convert SVGAnimatedString to string for SVG elements
376-
href: el.href?.baseVal || el.href || null,
377-
class: getClassName(el) || null
390+
role: toSafeString(el.getAttribute('role')),
391+
type_: toSafeString(el.getAttribute('type')),
392+
aria_label: toSafeString(el.getAttribute('aria-label')),
393+
// Handle both regular href and SVGAnimatedString href
394+
href: toSafeString(el.href),
395+
class: toSafeString(getClassName(el))
378396
},
379-
// Pass to WASM
380-
text: textVal || null,
397+
// Pass to WASM - ensure text is also a safe string
398+
text: toSafeString(textVal),
381399
in_viewport: inView,
382400
is_occluded: occluded
383401
});

sentience/extension/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "Sentience Semantic Visual Grounding Extractor",
4-
"version": "1.0.5",
4+
"version": "1.0.9",
55
"description": "Extract semantic visual grounding data from web pages",
66
"permissions": ["activeTab", "scripting"],
77
"host_permissions": ["<all_urls>"],
0 Bytes
Binary file not shown.

sentience/extension/release.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/272300094",
3-
"assets_url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/272300094/assets",
4-
"upload_url": "https://uploads.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/272300094/assets{?name,label}",
5-
"html_url": "https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/tag/v0.10.4",
6-
"id": 272300094,
2+
"url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/272366797",
3+
"assets_url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/272366797/assets",
4+
"upload_url": "https://uploads.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/272366797/assets{?name,label}",
5+
"html_url": "https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/tag/v1.0.9",
6+
"id": 272366797,
77
"author": {
88
"login": "github-actions[bot]",
99
"id": 41898282,
@@ -25,21 +25,21 @@
2525
"user_view_type": "public",
2626
"site_admin": false
2727
},
28-
"node_id": "RE_kwDOQshiJ84QOvg-",
29-
"tag_name": "v0.10.4",
28+
"node_id": "RE_kwDOQshiJ84QO_zN",
29+
"tag_name": "v1.0.9",
3030
"target_commitish": "main",
31-
"name": "Release v0.10.4",
31+
"name": "Release v1.0.9",
3232
"draft": false,
3333
"immutable": false,
3434
"prerelease": false,
35-
"created_at": "2025-12-22T19:42:33Z",
36-
"updated_at": "2025-12-22T19:43:39Z",
37-
"published_at": "2025-12-22T19:43:38Z",
35+
"created_at": "2025-12-23T03:09:03Z",
36+
"updated_at": "2025-12-23T03:10:45Z",
37+
"published_at": "2025-12-23T03:10:45Z",
3838
"assets": [
3939
{
40-
"url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/assets/331850955",
41-
"id": 331850955,
42-
"node_id": "RA_kwDOQshiJ84Tx6TL",
40+
"url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/assets/331995822",
41+
"id": 331995822,
42+
"node_id": "RA_kwDOQshiJ84Tydqu",
4343
"name": "extension-files.tar.gz",
4444
"label": "",
4545
"uploader": {
@@ -65,17 +65,17 @@
6565
},
6666
"content_type": "application/gzip",
6767
"state": "uploaded",
68-
"size": 63026,
69-
"digest": "sha256:f1f888c2b98e15c4433cee3a45e0109bbcef0dec0b4eef9d889156c45382f1ca",
68+
"size": 63205,
69+
"digest": "sha256:69ea28d2e30b9a168608be87c00ee0c678ed2893c90e6220727b885ac6c99e17",
7070
"download_count": 0,
71-
"created_at": "2025-12-22T19:43:39Z",
72-
"updated_at": "2025-12-22T19:43:39Z",
73-
"browser_download_url": "https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/download/v0.10.4/extension-files.tar.gz"
71+
"created_at": "2025-12-23T03:10:45Z",
72+
"updated_at": "2025-12-23T03:10:45Z",
73+
"browser_download_url": "https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/download/v1.0.9/extension-files.tar.gz"
7474
},
7575
{
76-
"url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/assets/331850954",
77-
"id": 331850954,
78-
"node_id": "RA_kwDOQshiJ84Tx6TK",
76+
"url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/assets/331995821",
77+
"id": 331995821,
78+
"node_id": "RA_kwDOQshiJ84Tydqt",
7979
"name": "extension-package.zip",
8080
"label": "",
8181
"uploader": {
@@ -101,16 +101,16 @@
101101
},
102102
"content_type": "application/zip",
103103
"state": "uploaded",
104-
"size": 65474,
105-
"digest": "sha256:798aa7b8a37ea110d25310ce62c4796245124a48202fa01ca7909d2fb13b07ee",
104+
"size": 65639,
105+
"digest": "sha256:cd3339d905ac5453d2652b6a8c3bd8f68a66bd45a2e6660aa2824a38e56d5f31",
106106
"download_count": 0,
107-
"created_at": "2025-12-22T19:43:39Z",
108-
"updated_at": "2025-12-22T19:43:39Z",
109-
"browser_download_url": "https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/download/v0.10.4/extension-package.zip"
107+
"created_at": "2025-12-23T03:10:45Z",
108+
"updated_at": "2025-12-23T03:10:45Z",
109+
"browser_download_url": "https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/releases/download/v1.0.9/extension-package.zip"
110110
}
111111
],
112-
"tarball_url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/tarball/v0.10.4",
113-
"zipball_url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/zipball/v0.10.4",
114-
"body": "## What's Changed\n* prune raw element by @rcholic in https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/pull/13\n\n\n**Full Changelog**: https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/compare/v0.10.3...v0.10.4",
112+
"tarball_url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/tarball/v1.0.9",
113+
"zipball_url": "https://api.github.com/repos/SentienceAPI/Sentience-Geometry-Chrome-Extension/zipball/v1.0.9",
114+
"body": "## What's Changed\n* svg string fix by @rcholic in https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/pull/14\n\n\n**Full Changelog**: https://github.com/SentienceAPI/Sentience-Geometry-Chrome-Extension/compare/v0.10.4...v1.0.9",
115115
"mentions_count": 1
116116
}

0 commit comments

Comments
 (0)