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

mobile navbar toggler's icon is blocked by CSP #226

Open
kenany opened this issue Nov 13, 2019 · 1 comment
Open

mobile navbar toggler's icon is blocked by CSP #226

kenany opened this issue Nov 13, 2019 · 1 comment

Comments

@kenany
Copy link
Member

kenany commented Nov 13, 2019

The navbar toggler that appears in mobile viewports has a "hamburger menu" icon that is unfortunately blocked by the site's CSP. The icon is defined inline:

.navbar-dark .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

Error from browser devtools:

Content Security Policy: The page’s settings blocked the loading of a resource at data:image/svg+xml,%3csvg viewBox='0 0 3… (“img-src”).

The fix could be to either adjust the CSP (within reason) to allow this inline image, or replace the image with the respective Font Awesome icon instead.

Expected

image

Actual

image

@xDashh
Copy link
Member

xDashh commented Dec 8, 2019

Adjusting the CSP seems like no big deal, but the "proper" solution is the other one, from what I can tell. Since this is a minor UI issue, I'd opt for the non-CSP solution.

@xDashh xDashh assigned kenany and unassigned xDashh Dec 8, 2019
@kenany kenany removed their assignment Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants