|
|
|
|
|
by thatgurjot
682 days ago
|
|
This is a great idea! Love the minimal implementation of it too. I have struggled with a similar but unrelated problem at my workplace before. This might just help with that. Will dig into the code! Some questions:
1. Are the “snippets” all just iframes?
2. How do you mitigate CORS issues?
3. Does it run best on the local machine only? If so, what potential issues do you think would crop up if it were hosted on a remote server? |
|
1. There's a bit more going on behind the scenes. The back-end opens the web page using Playwright (headless Chromium) and takes a screenshot. It's this image that gets displayed in the dashboard.
2. I also first thought about implementing most of the functionality client-side, using the user's browser to make requests, but like you suspect this quickly runs into CORS issues. Using the server to make requests avoids this, as it's a plain browser request and I then have full access to the rendered page.
3. It's being hosted on a remote server now; the back-end makes all the requests for you. Potential issues: