This commit is contained in:
Josh at WLTechBlog
2025-12-16 14:01:21 -07:00
parent 148b948a4b
commit 6f9839ee86

View File

@@ -13059,8 +13059,8 @@ func (d *Daemon) extractDiviStructure(tabID string, timeout int) (*DiviStructure
}
// JavaScript to extract Divi structure
jsCode := `
(function() {
// Note: page.Eval expects a function expression, not an IIFE
jsCode := `() => {
const result = {
url: window.location.href,
sections: [],
@@ -13198,8 +13198,7 @@ func (d *Daemon) extractDiviStructure(tabID string, timeout int) (*DiviStructure
});
return result;
})();
`
}`
// Execute JavaScript with timeout
var resultData interface{}
@@ -13265,8 +13264,8 @@ func (d *Daemon) extractDiviImages(tabID string, timeout int) ([]DiviImage, erro
}
// JavaScript to extract images
jsCode := `
(function() {
// Note: page.Eval expects a function expression, not an IIFE
jsCode := `() => {
const images = [];
let imageIndex = 0;
@@ -13310,8 +13309,7 @@ func (d *Daemon) extractDiviImages(tabID string, timeout int) ([]DiviImage, erro
});
return images;
})();
`
}`
// Execute JavaScript with timeout
var resultData interface{}
@@ -13377,8 +13375,8 @@ func (d *Daemon) extractDiviContent(tabID string, timeout int) (*DiviContent, er
}
// JavaScript to extract content
jsCode := `
(function() {
// Note: page.Eval expects a function expression, not an IIFE
jsCode := `() => {
const result = {
url: window.location.href,
modules: [],
@@ -13458,8 +13456,7 @@ func (d *Daemon) extractDiviContent(tabID string, timeout int) (*DiviContent, er
result.metadata.total_images = result.images.length;
return result;
})();
`
}`
// Execute JavaScript with timeout
var resultData interface{}