You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work as a Developer Advocate for Security and I am using this awesome starter kit (Profile Page HTML template) to bootstrap a demo in pure HTML and when testing the web page for the security headers I got a bad score because inline styles and inline javascript is used.
To build a secure webpage inline styles and inline script need to be removed.
CSS examples to move into the CSS file:
style="height: 500px;"
JS examples to move to the JS file...
from the html tags:
onclick="toggleNavbar('example-collapse-navbar')"
from the script tag:
<script>
function toggleNavbar(collapseID) {
document.getElementById(collapseID).classList.toggle("hidden");
document.getElementById(collapseID).classList.toggle("block");
}
</script>
The Content-Security-Policy header to test against:
@evbo I think it's more of an implementation issue. The inline CSS and Javascript above don't have anything specific to do with Tailwind. But rather, how toggleNavbar and some inline styles were implemented in this template. The inline script above could easily be moved into a .js file. The CSS is a similar case, a quick search of the project shows quite a few similar inline styles. These could be moved to a utility CSS file, or a tailwinds class could be used in place.
I work as a Developer Advocate for Security and I am using this awesome starter kit (Profile Page HTML template) to bootstrap a demo in pure HTML and when testing the web page for the security headers I got a bad score because inline styles and inline javascript is used.
To build a secure webpage inline styles and inline script need to be removed.
CSS examples to move into the CSS file:
JS examples to move to the JS file...
from the html tags:
from the script tag:
The
Content-Security-Policy
header to test against:Let me know if I can be of further help :)
The text was updated successfully, but these errors were encountered: