-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: load static webview resources with the editor from the same domain #411
Conversation
Signed-off-by: vitaliy-guliy <[email protected]>
Pull Request images published ✨ Editor: quay.io/che-incubator-pull-requests/che-code:pr-411-amd64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vitaliy-guliy does it make sense to create an issue for Che-Code currently doesn't support loading from CDN? |
It's difficult to say whether or not using the CDN gives some benefits. FYI, to make it working on our side we patched the html file which is used to initialize the webview iframe. You can just compare the upstream |
@azatsarynnyy thanks for the review! |
Build 3.17 :: code_3.x/1468: Console, Changes, Git Data |
Build 3.17 :: sync-to-downstream_3.x/7689: Console, Changes, Git Data |
Build 3.17 :: get-sources-rhpkg-container-build_3.x/7681: code : 3.x :: Failed in 64065315 : BREW:BUILD/STATUS:UNKNOWN |
…in (#411) Signed-off-by: vitaliy-guliy <[email protected]>
What does this PR do?
Normally, Visual Studio Code loads the webview static resources from a CDN.
After merging this PR the webview static resources in Che-Code ( there are several files https://github.com/che-incubator/che-code/tree/main/code/src/vs/workbench/contrib/webview/browser/pre ) will be loaded from the same location as the editor ( from the same host ).
Before, we added an option for turning this feature on for instances that are behind a proxy.
Probably something related to the cross-domain policy has been changed in the upstream (but I cannot say for sure) and it brought us some isues with handling the webview events. If the webview scripts are loaded from the same host as the editor, the events are not blocked, so loading everything from one place is the cheapest way to fix the problem.
The feature is still configurable. It can be turned off by defining
WEBVIEW_LOCAL_RESOURCES=false
environment variable for tooling container. But this thing could be discussed. To not confuse the user we can give up using theWEBVIEW_LOCAL_RESOURCES
variable at all.What issues does this PR fix?
eclipse-che/che#22986
How to test this PR?
Get started
and in the appearedAnsible content creator
tab check that clicking on the links works.It would be nice to open any walkthrough that has a markdown (display the content on the right) and check that clicking works as well.
Does this PR contain changes that override default upstream Code-OSS behavior?
git rebase
were added to the .rebase folder