mirror of https://github.com/kortix-ai/suna.git
fix/bg_images
This commit is contained in:
parent
9c1d084682
commit
37ef70f6c1
|
@ -196,7 +196,7 @@ class OptimizedHTMLToPPTXConverter:
|
|||
|
||||
# Use file:// URL instead of set_content to preserve relative paths
|
||||
file_url = f"file://{html_path.resolve()}"
|
||||
await page.goto(file_url, wait_until="domcontentloaded", timeout=10000)
|
||||
await page.goto(file_url, wait_until="networkidle", timeout=25000)
|
||||
await page.wait_for_timeout(1000)
|
||||
|
||||
def handle_console(msg):
|
||||
|
@ -436,7 +436,7 @@ class OptimizedHTMLToPPTXConverter:
|
|||
console.log('borderStyle:', computed.borderStyle);
|
||||
|
||||
// Skip very large elements that are likely backgrounds
|
||||
const isLikelyBackground = rect.width > 1200 || rect.height > 900;
|
||||
const isLikelyBackground = rect.width > 1700;
|
||||
|
||||
if (!isLikelyBackground) {
|
||||
results.push({
|
||||
|
@ -647,7 +647,7 @@ class OptimizedHTMLToPPTXConverter:
|
|||
|
||||
# Use file:// URL instead of set_content to preserve relative paths
|
||||
file_url = f"file://{html_path.resolve()}"
|
||||
await page.goto(file_url, wait_until="domcontentloaded", timeout=10000)
|
||||
await page.goto(file_url, wait_until="networkidle", timeout=25000)
|
||||
|
||||
# Reduced wait time
|
||||
await page.wait_for_timeout(2000)
|
||||
|
@ -682,7 +682,7 @@ class OptimizedHTMLToPPTXConverter:
|
|||
function hideVisualElements() {
|
||||
visualElementsData.forEach(visualData => {
|
||||
// Skip very large elements that are likely the main background
|
||||
if (visualData.width > 1000 || visualData.height > 800) {
|
||||
if (visualData.width > 1700) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -750,7 +750,7 @@ class OptimizedHTMLToPPTXConverter:
|
|||
|
||||
# Use file:// URL instead of set_content to preserve relative paths
|
||||
file_url = f"file://{html_path.resolve()}"
|
||||
await page.goto(file_url, wait_until="domcontentloaded", timeout=10000)
|
||||
await page.goto(file_url, wait_until="networkidle", timeout=25000)
|
||||
|
||||
# Reduced wait time
|
||||
await page.wait_for_timeout(2000)
|
||||
|
|
|
@ -297,7 +297,7 @@ class PerfectHTMLToPPTXConverter:
|
|||
|
||||
# Use file:// URL instead of set_content to preserve relative paths
|
||||
file_url = f"file://{html_path.resolve()}"
|
||||
await page.goto(file_url, wait_until="domcontentloaded", timeout=10000)
|
||||
await page.goto(file_url, wait_until="networkidle", timeout=25000)
|
||||
await page.wait_for_timeout(1000)
|
||||
|
||||
def handle_console(msg):
|
||||
|
@ -537,7 +537,7 @@ class PerfectHTMLToPPTXConverter:
|
|||
console.log('borderStyle:', computed.borderStyle);
|
||||
|
||||
// Skip very large elements that are likely backgrounds
|
||||
const isLikelyBackground = rect.width > 1200 || rect.height > 900;
|
||||
const isLikelyBackground = rect.width > 1700;
|
||||
|
||||
if (!isLikelyBackground) {
|
||||
results.push({
|
||||
|
@ -748,7 +748,7 @@ class PerfectHTMLToPPTXConverter:
|
|||
|
||||
# Use file:// URL instead of set_content to preserve relative paths
|
||||
file_url = f"file://{html_path.resolve()}"
|
||||
await page.goto(file_url, wait_until="domcontentloaded", timeout=10000)
|
||||
await page.goto(file_url, wait_until="networkidle", timeout=25000)
|
||||
|
||||
# Reduced wait time
|
||||
await page.wait_for_timeout(2000)
|
||||
|
@ -783,7 +783,7 @@ class PerfectHTMLToPPTXConverter:
|
|||
function hideVisualElements() {
|
||||
visualElementsData.forEach(visualData => {
|
||||
// Skip very large elements that are likely the main background
|
||||
if (visualData.width > 1000 || visualData.height > 800) {
|
||||
if (visualData.width > 1700) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -851,7 +851,7 @@ class PerfectHTMLToPPTXConverter:
|
|||
|
||||
# Use file:// URL instead of set_content to preserve relative paths
|
||||
file_url = f"file://{html_path.resolve()}"
|
||||
await page.goto(file_url, wait_until="domcontentloaded", timeout=10000)
|
||||
await page.goto(file_url, wait_until="networkidle", timeout=25000)
|
||||
|
||||
# Reduced wait time
|
||||
await page.wait_for_timeout(2000)
|
||||
|
|
|
@ -72,14 +72,10 @@ class SandboxPresentationTool(SandboxToolsBase):
|
|||
}}
|
||||
|
||||
body {{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: {style_config['font_family']};
|
||||
background: #000000;
|
||||
color: {style_config['text_color']};
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
overflow: hidden;
|
||||
}}
|
||||
|
||||
.slide-container {{
|
||||
|
|
Loading…
Reference in New Issue