Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support pdf printer #653

Merged
merged 1 commit into from
Jul 26, 2024
Merged

support pdf printer #653

merged 1 commit into from
Jul 26, 2024

Conversation

LawyZheng
Copy link
Collaborator

@LawyZheng LawyZheng commented Jul 26, 2024

🚀 This description was created by Ellipsis for commit 7b985ad

Summary:

Added support for handling PDF printing by modifying click action handler and injecting a script to disable the default print dialog.

Key points:

  • Added get_download_dir function in skyvern/webeye/browser_factory.py to initialize download directory.
  • Modified handle_click_to_download_file_action in skyvern/webeye/actions/handler.py to handle PDF printing.
  • Introduced DISABLE_PRINTER_WITH_FLAG script in skyvern/webeye/utils/page.py to disable default print dialog.
  • Updated create_browser_context in skyvern/webeye/browser_factory.py to inject the print disabling script.

Generated with ❤️ by ellipsis.dev

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 7b985ad in 50 seconds

More details
  • Looked at 159 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_tfj2m5lZEBpfGpSt


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

await page.wait_for_load_state(timeout=SettingsManager.get_settings().BROWSER_LOADING_TIMEOUT_MS)
# TODO: shall we back to the previous page ?
if await SkyvernFrame.get_print_triggered(page):
path = f"{get_download_dir(task.workflow_run_id, task.task_id)}/{uuid.uuid4()}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider implementing a cleanup mechanism for the PDF files generated by the handle_click_to_download_file_action function to avoid potential disk space issues.

@LawyZheng LawyZheng merged commit be75055 into main Jul 26, 2024
2 checks passed
@LawyZheng LawyZheng deleted the support-pdf-printer branch July 26, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant