SRI Fixer finds HTML files in your project, and automatically adds Subresource Integrity hashes to <script> and <link> tags
Installing SRI Fixer requires that your system has Go installed
We don't currently publish prebuilt binaries, so you'll need to compile sri-fixer for your system:
git clone https://github.com/audunmo/sri-fixer
cd sri-fixer
go install
# If all has gone well, this should print a message from sri-fixer
sri-fixer
# If your shell doesn't find sri-fixer, ensure that $(go env GOPATH)/bin is in your $PATHSRI Fixer is designed with the philosophy that it should just Do The Right Thing™, and do only one thing, without config or input.
Navigate to your project root, and run sri-fixer run --origin "https://your-sites-domain.xyz". It will update the HTML files in-place
- Docs site
- Publish to brew
- Debug logs
- Automated testing in testcafe
- Optional hashing of self-hosted
<scripts>/<links> - Ignoring multiple domains