menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

Theia

Eclipse Theia - Cloud & Desktop IDE

Channels
Team

How do I open the preview panel?

May 5, 2020 at 6:04pm

How do I open the preview panel?

May 5, 2020 at 6:04pm
Show previous messages

May 5, 2020 at 6:12pm
If a file supports previews (ex: 'markdown'), you can open it a number of ways:
  • open the file's sources and click the open preview toolbar item
  • right-click the file in the explorer and select Open With > Preview
This depends however on what you include as dependencies/extensions in your application.
i mean like this
nvm got it
Though it never loads the preview for me. It is always a white screen. Is there a way to fix this?
can you share what you’re attempting to preview, perhaps a screenshot?
sure but it is not just one thing. Even stuff like google won't load.
And
I believe the use-case you're trying to achieve might not work due to security reasons. Please see the relevant discussions here: https://github.com/eclipse-theia/theia/issues/3169
There is also an error reported which might be useful to you: "Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'."
I'll look
It says it should work now. Any idea why it wouldn't?
Edited
I think based on the error message it is due to increased security, the comment on the issue was likely written before security updates. If I’m mistaken perhaps others can chime in.
Oh that's unfortunate.

May 6, 2020 at 8:04am
many websites does not allow embedding because of security issues, so it is expected
main use case for mini-browser it is to preview changes to a app or some html files on which you are working on

May 6, 2020 at 9:41pm
i understand that it is only for html/css and markdown files but is it possible to somehow access localhost on it?
because the example I first posted they got it to work.

May 7, 2020 at 6:32am
localhost always points to your local machine, you should use the remote address
Theia is generally using https://github.com/eclipse-theia/theia/blob/c2ffdc71b63ddd761f6a1d2903d7dd9c05f14466/packages/core/src/browser/external-uri-service.ts#L46 to remap localhost to external URI, but I don't think it is used by the mini browser.
Do you know how to auto remap localhost to externally accessible URL for the mini browser?

May 7, 2020 at 2:58pm
I'm running the yarn version of theia in a docker container cause im not sure how to make the ui work for the image. So I don't really know what the public ip would be.
Show more messages