Comments (4)
I am just running the example without any changes.
Here is CSP i see :
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src ${webview.cspSource}; script-src 'nonce-${nonce}';">
from vscode-webview-ui-toolkit-samples.
Hey @Askhento!
Could you provide more context (and code snippets) on how you're trying to style the button?
The hello-svelte
sample does actually enable the default script and style CSP rules (see here).
But reading the errors you sent it looks like there's something more going on since it's recommending that you set the script-src-elem
rule and either set unsafe-inline
or add a hash/nonce to your styles CSP as potential solutions to the errors you're seeing.
from vscode-webview-ui-toolkit-samples.
Ahhh I see, thanks for clarifying.
I installed a fresh copy of the hello-world-svelte
sample and was able to partially reproduce the errors you're seeing:
- The button styling looks fine on my end –– in fact as I look back at your screenshot that button also looks correct, could you explain a bit more about the styling issue you're seeing?
- I did reproduce the
style-src
error and was reminded this is actually an issue with an upstream dependency of the toolkit but from all my testing it doesn't actually seem to result in any tangible problems when building an extension (just an annoying error that I think can be safely ignored) - I could not reproduce the
script-src
error –– perhaps you should try to deletenode_modules
and reinstall (or maybe even delete and reinstall the entire sample?)
from vscode-webview-ui-toolkit-samples.
I've updated my launch.json
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--disable-extensions"
],
Seems like the color matched my theme, as should)
But still with fresh reinstall node_modules I see the same error with livereload.js. Seems like it comes from rollup-plugin-livereload.
from vscode-webview-ui-toolkit-samples.
Related Issues (20)
- Update hello-world-angular sample to Angular versions ^15.0.0.0 HOT 2
- ALL HelloWorld samples improperly leak content (fail to properly dispose) HOT 3
- webview-ui-toolkit doesn't work in vscode extension HOT 5
- Hello-world-svelte register allComponents does not seems to do anything HOT 3
- Update esbuild config in all extensions
- webview angular assets/i18n/en.json access denied HOT 4
- hello-world-react-cra sample cannot work HOT 1
- JS sample with Vite + React? HOT 4
- Running `vsce package` on Svelte hello-world does not package webview resources to .vsix HOT 2
- Hello World React Vite CSP console error HOT 1
- Notes sample with CustomEditor API HOT 2
- Add content security policies to all sample extensions HOT 3
- Create sample extension using SolidJS HOT 2
- Add docs that provide general directions for using a web framework in webviews HOT 2
- Update toolkit declaration file in Solid sample
- Cannot register UI components in new Angular component. HOT 5
- Can't get a clean build (on windows) for angular hello-world HOT 1
- Angular sample; can't use webview-ui-toolkit UI elements in a form HOT 1
- not using npm --prefix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-webview-ui-toolkit-samples.