Code-server: Markdown preview not working

Created on 19 Mar 2019  ·  6Comments  ·  Source: cdr/code-server


  • code-server version: 1.31.1-100, also tested on 1.32.0-310
  • OS Version: Chrome OS

Description


When attempting to view an in-VSCode markdown preview, the following error appears:

command 'markdown.showPreview' not found

Steps to Reproduce

  1. Open a Markdown (.md) file
  2. Use the keyboard shortcut Ctrl-Shift-V to attempt to show Markdown preview
  3. Error appears in the lower right corner of the screen
bug

Most helpful comment

Will fix!

All 6 comments

Will fix!

Markdown preview does not seem to work on latest release (2.1698-vsc1.41.1). There are no errors, but the preview window is empty.

@code-asher

Seems to be an IFRAME security issue. By opening the browser debugging tools,

On Firefox:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://v1.extapi.coder.com/extensionquery. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://v1.extapi.coder.com/extensionquery. (Reason: CORS request did not succeed).
Load denied by X-Frame-Options: “DENY” from “https://<redacted>.com/webview/index.html?id=<redacted>”, site does not permit any framing. Attempted to load into “https://<redacted>.com/?folder=vscode-remote%3A%2F%2Fcode-server%3A8080%2F<redacted>”.

On Chrome:

Refused to display 'https://<redacted>.com/webview/index.html?id=<redacted>' in a frame because it set 'X-Frame-Options' to 'deny'.

Opened #1409 for you @ViRb3

Apologies, the problem was in an inherited nginx config:

# XSS
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";

Everything works after I cleared those headers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sa7mon picture sa7mon  ·  3Comments

lshamis picture lshamis  ·  3Comments

broady picture broady  ·  3Comments

justmao945 picture justmao945  ·  3Comments

avelino picture avelino  ·  3Comments