Skip to content
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

CSP Nonce Support #21

Open
ajsheldon93 opened this issue Apr 4, 2022 · 2 comments
Open

CSP Nonce Support #21

ajsheldon93 opened this issue Apr 4, 2022 · 2 comments

Comments

@ajsheldon93
Copy link

Getting the error:
vendor.js:653 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' https://fonts.googleapis.com 'nonce-gNubTa9xLIALXt6z6cKEdnsNwMUGMx6d'". Either the 'unsafe-inline' keyword, a hash ('sha256-UTjtaAWWTyzFjRKbltk24jHijlTbP20C1GUYaWPqg7E='), or a nonce ('nonce-...') is required to enable inline execution.

This is caused by the inline styles injected from this plugin.

Can support for a nonce be added? unsafe-inline is not allowed in my application.

@d8vjork
Copy link

d8vjork commented Jun 15, 2022

Have this same problem on mine as well, looking forward to have a solution for this

@RJ2020DD
Copy link

RJ2020DD commented Jul 6, 2022

It's not resolving the nonce issue but to get around it I did the following:

  1. When initializing InertiaProgress set 'includeCSS' to false;
InertiaProgress.init({ includeCSS: false });
  1. In my main CSS file import the default nprogress css;
@import 'nprogress/nprogress.css';
  1. Then override the default colours;
#nprogress .bar {
    background: #29d;
}

#nprogress .peg {
    box-shadow: 0 0 10px #29d, 0 0 5px #29d;
}

#nprogress .spinner-icon {
    border-top-color: #29d;
    border-left-color: #29d;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants