OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

Fix export conversation button in Safari

Open csmith49 opened this issue 9 months ago • 0 comments

Description

This PR fixes the issue with the "export conversation" button not working in Safari browsers.

Problem

The current implementation uses the File System Access API (showSaveFilePicker), which is not supported in Safari. This causes the export functionality to fail silently in Safari browsers.

Solution

Implemented a fallback mechanism that uses the traditional download method (downloadJSON) when the File System Access API is not available. This ensures that the export functionality works across all browsers, including Safari.

Changes

  • Modified downloadTrajectory function to check for browser support and use appropriate download method
  • Added fallback to use downloadJSON for browsers that do not support File System Access API
  • Added error handling to fall back to traditional download method if the user cancels the save dialog or any other error occurs

csmith49 avatar Apr 02 '25 15:04 csmith49