This commit is contained in:
Josh at WLTechBlog
2025-10-02 15:01:30 -05:00
parent 3b08b7ea8f
commit 741bd19bd9
4 changed files with 257 additions and 4 deletions

View File

@@ -9361,7 +9361,7 @@ func (d *Daemon) testZoom(tabID string, zoomLevels []float64, timeout int) (*Zoo
// Text is readable if minimum font size is at least 9px (WCAG recommendation)
const textReadable = minFontSize >= 9;
return {
return JSON.stringify({
viewport_width: window.innerWidth,
viewport_height: window.innerHeight,
has_horizontal_scroll: hasHorizontalScroll,
@@ -9371,7 +9371,7 @@ func (d *Daemon) testZoom(tabID string, zoomLevels []float64, timeout int) (*Zoo
overflowing_elements: overflowingCount,
text_readable: textReadable,
min_font_size: minFontSize
};
});
}`
var jsResult *proto.RuntimeRemoteObject
@@ -9428,13 +9428,15 @@ func (d *Daemon) testZoom(tabID string, zoomLevels []float64, timeout int) (*Zoo
// Parse the results
var zoomTest ZoomLevelTest
err = json.Unmarshal([]byte(jsResult.Value.Str()), &zoomTest)
resultStr := jsResult.Value.Str()
d.debugLog("Zoom test result string: %s", resultStr)
err = json.Unmarshal([]byte(resultStr), &zoomTest)
if err != nil {
result.Issues = append(result.Issues, ZoomTestIssue{
ZoomLevel: zoom,
Type: "parse_error",
Severity: "high",
Description: fmt.Sprintf("Failed to parse results: %v", err),
Description: fmt.Sprintf("Failed to parse results (got: %s): %v", resultStr, err),
})
continue
}