Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Convert HTML from unsafe inline handlers to CSP-safe external scripts (github.com/00000o1)
1 point by keepamovin 7 months ago | hide | past | favorite | 3 comments



Good day HN! I recently had a need to write a simple HTML static site that needed some JS functionality. I wanted to use inline handlers, but didn't like how they were 'unsafe inline', so I made this simple Python3 script to convert all inline handlers to a safer external script, with the CSP hash output to boot!

Check it out, maybe you can use it, maybe it can help you write HTML easily, but then harden it to make it more secure, so you don't have to serve it with 'unsafe inline' CSP header! :)


This goes to a 404 - is the repository private?


Yes! Haha, thank you for that. Silly me! Hahaha. I made it public now. So ridiculous I posted a Show to 404 hahaha




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: