Skip to content

Commit a4f7467

Browse files
committed
Return data JSON-stringified
1 parent f7522aa commit a4f7467

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dist/content-visibility.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,11 @@
160160

161161
// Try to execute the metric, with ultimate fallback
162162
try {
163-
return contentVisibility();
163+
const result = contentVisibility();
164+
return JSON.stringify(result);
164165
} catch (error) {
165166
// Ultimate fallback - if even the main function fails
166-
return {
167+
const fallbackResult = {
167168
used: false,
168169
count: 0,
169170
values: [],
@@ -175,5 +176,6 @@
175176
errors: ['ultimate_error: ' + error.message]
176177
}
177178
};
179+
return JSON.stringify(fallbackResult);
178180
}
179181
})();

0 commit comments

Comments
 (0)