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

Add a way to download the html #3

Closed
SawyerHood opened this issue May 30, 2024 · 0 comments
Closed

Add a way to download the html #3

SawyerHood opened this issue May 30, 2024 · 0 comments

Comments

@SawyerHood
Copy link
Owner

SawyerHood commented May 30, 2024

Right now there is no way to actually download the generated html into the canvas. We should add a download button in BrowserShape.tsx in the address bar.

SawyerHood added a commit that referenced this issue May 30, 2024
Related to #3

Adds a download button to the `BrowserShape.tsx` component, enabling users to download the generated HTML content of the iframe directly to their device.

- Implements a `handleDownload` function that creates a Blob from the iframe's HTML content, generates a URL for it, and triggers a download operation using a temporary anchor element.
- Adds a new download button to the address bar section, utilizing the `Download` icon from `lucide-react`, and binds the `handleDownload` function to its `onClick` event.
- Ensures the download functionality is only available when there is HTML content to download by checking the presence of `shape.props.html` before proceeding with the download operation.


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/SawyerHood/tlbrowse/issues/3?shareId=a8cc8a94-7a7f-46ab-8c0a-406833e1ffab).
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

No branches or pull requests

1 participant