Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions extension/src/entrypoints/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@ function handleBlur(event: FocusEvent) {

export default defineContentScript({
matches: ["<all_urls>"],
allFrames: true,
matchAboutBlank: true,
main(ctx) {
// Listener for status updates from the background script
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
Expand Down
11 changes: 8 additions & 3 deletions workflows/workflow_use/builder/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,20 @@ async def build_workflow(
images_used = 0
for step in input_workflow.steps:
step_messages: List[Dict[str, Any]] = [] # Messages for this specific step

step_dict = step.model_dump(mode='json', exclude_none=True)
step_type = getattr(step, 'type', step_dict.get('type'))
step_url = getattr(step, 'url', step_dict.get('url', ''))
# Skip steps to avoid processing empty or irrelevant navigation steps, mostly from iframes.
if step_type == 'navigation' and step_url == 'about:blank':
continue

# 1. Text representation (JSON dump)
step_dict = step.model_dump(mode='json', exclude_none=True)
screenshot_data = step_dict.pop('screenshot', None) # Pop potential screenshot
step_messages.append({'type': 'text', 'text': json.dumps(step_dict, indent=2)})

# 2. Optional screenshot
attach_image = use_screenshots and images_used < max_images
step_type = getattr(step, 'type', step_dict.get('type'))
attach_image = use_screenshots and images_used < max_images

if attach_image and step_type != 'input': # Don't attach for inputs
# Re-retrieve screenshot data if it wasn't popped (e.g., nested under 'data')
Expand Down