Closed chavaroon closed 3 years ago
Maybe a dup of https://github.com/microsoft/vscode/issues/92323
From https://github.com/microsoft/vscode/issues/92323#issuecomment-611045838:
Can you check
svg
You should see Content Type image/svg+xmlOk, saw #92323.
HKEY_CLASSES_ROOT\.svg
Content Type
text/xml
.Content Type
with image/svg+xml
, as suggested.Thank you, so much.!
EDIT:
@deepak1556 @sandy081 This issue has been reported several times.
Any chance we can force Electron to use 'our' content types? For VSCode as a application, there's no point of using a custom content types for svg images.
Yup we can, we already do something close enough to block svg images from remote urls https://github.com/microsoft/vscode/blob/master/src/vs/code/electron-main/window.ts#L404-L413 . We can modify the condition a bit for local urls and edit the content-type in onHeadersReceived
. The headers received in this method are from network layer before they have reached the renderer, so any response modified here will only be used for further processing by the renderer.
if (details.url.indexOf('.svg') > 0) {
const uri = URI.parse(details.url);
// I assume the svg are currently served over file
// If its vscode-resource, change condition according to the scheme
if (uri && uri.scheme.match(/file/i)) {
responseHeaders['content-type'] = 'image/svg+xml'
return callback({ cancel: false, ...responseHeaders });
}
}
Triage: if this is indeed a dup of #92323, perhaps this issue can be closed?
@wmertens this issue tracks the solution to prevent svg being loaded with incorrect Content-Type headers.
I still see the issue in Version: 1.53.0-insider (user setup) Commit: 5a52bc29d5e9bc419077552d336ea26d904299fa Date: 2021-01-29T05:13:48.533Z Electron: 11.2.1 OS: Windows_NT x64 10.0.19042
regedit
, search for .svg
, change image/svg+xml
to text/xml
/cc @rzhao271
I have an issue that looks similar with VSCode 1.53.2 on Ubuntu 20.04: the SVG icons I use in an extension, on both tree view items and inside webviews, don't show.
Their PNG equivalents show, so it seems that SVG is specifically blocked (confirmed by the Webview Development Tools that show a download size of "0 B" for the SVG).
Could it be related, or shall I open another ticket?
Hi guys, can someone point me to a similar fix on mac. I have this issue with my docker extension. thanks
This should be fixed since a while. If you still see it, please follow the steps in https://github.com/microsoft/vscode/issues/97564#issuecomment-627292788
If that doesn't help or apply, please file a new issue.
The current mitigation is https://github.com/microsoft/vscode/issues/97564#issuecomment-627351149
I used those steps to intentionally change the type back to text/xml
, and I noticed that the issue still repros.
Issue Type: Bug
Try to set File Icon Theme to other than Seti (Visual Studio Code), and file icons will show no icons (or an empty tab space as icon). Also, somehow the root cause affected my 'Bookmarks' Extension which shows no icon.
I've downgraded VSCode to version 1.42, and the issue is not present there. I'm pretty sure the issue is not related to VSCode version, as I have installed the latest version to another PC, and the issue is not present there.
I've also reinstalled VSCode as many as four or five times, deleting some tmp files from VSCode, but have not got rid of the issue.
VS Code version: Code 1.45.0 (d69a79b73808559a91206d73d7717ff5f798f23c, 2020-05-07T16:18:48.860Z) OS version: Windows_NT x64 10.0.17763
System Info
|Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz (8 x 1896)| |GPU Status|2d_canvas: enabledflash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|7.85GB (1.98GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Extensions (6)
Extension|Author (truncated)|Version ---|---|--- Bookmarks|ale|11.2.0 bracket-pair-colorizer|Coe|1.0.61 python|ms-|2020.4.76186 cpptools|ms-|0.28.0-insiders3 vscode-icons|vsc|10.1.1 srecord|xia|0.0.3