A.Richard
A.Richard

Reputation: 45

vscode TreeItem icon with http URI

In my own vscode extension, I have implemented my own TreeDataProvider and my own TreeItem. I want to set Icons on my TreeItems. A possible type of iconPath of TreeItems is Uri. When I try to set an http://my.site/my/icon/Icon.svg Uri to my TreeItems, I've got an execution error with the following message : "Content Security Policy of your site blocks some resources, Resource http://my.site/my/icon/Icon.svg is blocked for directive img-src"

How to set a Content Security Policy for Uri in a vscode extension (I'm not in a Webview, I'm in a Tree) ? Is it possible to set http... icon paths for TreeItems ?

Best regards,

Upvotes: 0

Views: 236

Answers (1)

Mike Lischke
Mike Lischke

Reputation: 53407

You cannot set your own CSP outside of a webview. The tree can only show icons from trusted websites or from local file system.

Unfortunately I cannot find the place in the documentation where this is mentioned. I only remember that Github is one of the trusted sources.

Upvotes: 1

Related Questions