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

How to load an arbitrary page for screenshots #31

Open
damonftl opened this issue Aug 8, 2024 · 0 comments
Open

How to load an arbitrary page for screenshots #31

damonftl opened this issue Aug 8, 2024 · 0 comments

Comments

@damonftl
Copy link

damonftl commented Aug 8, 2024

This isn't really a bug or a feature request, I just have an incredibly basic question. Hopefully someone is still watching this repo.

I have everything working just fine, and it's all in a React app. I've got the following line:

const screenshot = (await Pico.dataURL(window, {})).value;

and "screenshot" is then the image of the currently-open page when I click a button set up to do the screenshot.

The question is how do I get it to work on some arbitrary page? The examples for the library show wikipedia - how was that accomplished? I've tried doing something like "let arbitraryWindow = window.open("https://wikipedia.org")" and then running Pico on arbitraryWindow but that does not work. I'm sure this is something incredibly simple. Thanks for any help.

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