microsoft / microsoft/vscode-livepreview
Improve experience when using Codespaces
@andreamah is already working on this.
Since Aug 8, 2022.
- Dominant language
- TypeScript
- Stars
- 596
- Forks
- 119
- Avg merge
- 1d 4m
- Merged PRs (30d)
- 5
Description
Currently, as mentioned in #58, the embedded preview will not immediately work in Codespaces upon first launching (or sometimes just upon forwarding a port). This is because the content at the local address is not actually available until the user goes through some redirects in their browser. Since one of these redirects is github.com and github can't be framed in an iframe, it shows an error.
There isn't a way to see whether this failure happened from the extension side, so it's difficult to implement some type of fix upon failure.
Without help from the GitHub side in regards to detecting whether these redirects have happened and no way to perform the redirects programmatically, we could probably do something like:
- Upon port forwarding, show an info message containing a link to tell you how to get around the issue OR a button that runs the
open external previewcommand immediately. There should be a "don't show again" on this and perhaps some info on how to fix the issue yourself. However, I'm not too sure if there's currently an API to show a warning message, asPortAttributesdoes not seem to support this.
In the most ideal case, we would have a way to programmatically trigger the redirects, although they are most likely there for a reason (security, cookies).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.