GithubHelp home page GithubHelp logo

Comments (7)

Mutantpenguin avatar Mutantpenguin commented on September 25, 2024 2

Could you please try ./RegeIn/style/html-theme.css

I did so and it doesn't work and gives the same error message.

Even when I place the file directly in my workspace root so I don't need to use \, \\ or / I get the same error message.

from asciidoctor-vscode.

ggrossetie avatar ggrossetie commented on September 25, 2024 1

I was able to reproduce it. It's not a path issue it's a Content Security Policy

index.html:1 Refused to load the stylesheet 'https://fonts.googleapis.com/css?family=Nova+Round' because it violates the following Content Security Policy directive: "style-src 'self' 'self' https://*.vscode-cdn.net 'unsafe-inline' data:". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.
index.html:1 Refused to load the stylesheet 'https://fonts.googleapis.com/css?family=Noto+Sans:300,600italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700' because it violates the following Content Security Policy directive: "style-src 'self' 'self' https://*.vscode-cdn.net 'unsafe-inline' data:". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.
index.html:1 Refused to load the stylesheet 'https://cdn.jsdelivr.net/gh/asciidoctor/[email protected]/data/stylesheets/asciidoctor-default.css' because it violates the following Content Security Policy directive: "style-src 'self' 'self' https://*.vscode-cdn.net 'unsafe-inline' data:". Note that 'style-src-elem' was not explicitly set, so 'style-src' is used as a fallback.

You can workaround this issue by disabling the CSP.

from asciidoctor-vscode.

ggrossetie avatar ggrossetie commented on September 25, 2024 1

We probably need to add https: in style-src and script-src:

const rules = {
'default-src': ['\'none\''],
'img-src': ['\'self\'', rule, 'https:', 'data:', krokiServerUrl],
'object-src': ['\'self\'', rule, 'https:', 'data:', krokiServerUrl],
'media-src': ['\'self\'', rule, 'https:', 'data:', krokiServerUrl],
'script-src': [`'nonce-${nonce}'`, `'${highlightjsInlineScriptHash}'`, 'https://*.vscode-cdn.net/'],
'style-src': ['\'self\'', rule, '\'unsafe-inline\'', 'data:'],
'font-src': ['\'self\'', rule, 'https:', 'data:', 'about:'],
}

from asciidoctor-vscode.

ggrossetie avatar ggrossetie commented on September 25, 2024

Could you please try ./RegeIn/style/html-theme.css

from asciidoctor-vscode.

cunka avatar cunka commented on September 25, 2024

Just to confirm its not isolated - I have had the same issue with asciidoc.preview.style as Mutantpenguin and get the same error message - albeit, I am using my own custom stylesheet and not the one Mutantpenguin is using.

It was working, and working well.

from asciidoctor-vscode.

ggrossetie avatar ggrossetie commented on September 25, 2024

I can't see what changed between 3.1.5 and 3.1.7 🤔
@cunka could you please share your error message? maybe I can find a pattern... are you on Windows? do you use \\? did you try to replace \\ by / (since it's a URI and not a file path)

from asciidoctor-vscode.

cunka avatar cunka commented on September 25, 2024

Yes - I'm a WINDOWS 10 user.
Had the paths set up as \ - as per this other bug i mentioned. https://github.com/asciidoctor/asciidoctor-vscode/issues/777#issuecomment-1676297112

It was working and I could use the webview to edit/modify the stylesheet all in VSCode and then it stopped working.
Outside of the VSCode updates, I'm wondering if something was enforced by Microsoft in a recent OS update.

I'm glad you have found a solution.

from asciidoctor-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.