Opening links doesn't work in the Che-Code editor
Describe the bug
It's not possible to open a link in the Che-Code editor.
Che version
7.86@latest
Steps to reproduce
Click on a link of a md file (just for example, you can try another way to test it) => nothing happens = a new tab is not opened
Expected behavior
Opening links should work for the Che-Code editor
Runtime
I was able to reproduce the problem on the dogfooding instance
Command related links also don't work in the editor:
screencast-che-dogfooding.apps.che-dev.x6e0.p1.openshiftapps.com-2024.08.30-13_58_47.webm
It looks like it depends on cross-domain secutiry policy. Normally the webview static resources are loaded from the CDN https://github.com/che-incubator/che-code/blob/main/code/product.json#L34 which has a different domain.
Having a quick debug I see the clicking the link is blocked somewhere under the hood ( it needs the additional investigation ).
As a workaround it is possible to configure webview resources to be loaded from the current cluster.
To do that it needs to define WEBVIEW_LOCAL_RESOURCES environment variable for the tools container and restart the workspace from local devfile.
components:
- name: tools
container:
image: registry.redhat.io/devspaces/udi-rhel8:3.15
endpoints:
- exposure: public
name: nodejs
protocol: https
targetPort: 3000
env:
- name: WEBVIEW_LOCAL_RESOURCES
value: "true"
memoryLimit: '1Gi'
memoryRequest: '512Mi'
cpuLimit: '0.5'
cpuRequest: '0.25'
mountSources: true
volumeMounts:
- name: npm
path: /home/user/.npm
Reopening it as the webviews do not work when static resources were taken from the same domain as editor and the browser do not trust self-signed certificate.