Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Polymer
  3. Crisper

Crisper

BSD-3-ClauseJavaScript

A tool that extracts inline JavaScript from HTML files to enable Content Security Policy compliance.

GitHubGitHub
106 stars22 forks0 contributors

What is Crisper?

Crisper is a Node.js tool that extracts inline JavaScript from HTML files into separate external files. It solves the problem of Content Security Policy (CSP) compliance by eliminating the need for unsafe-inline directives, allowing developers to implement stricter security policies.

Target Audience

Web developers and security engineers working on projects that require CSP compliance, particularly those using Polymer or build tools like Vulcanize, Gulp, or Grunt.

Value Proposition

Developers choose Crisper because it provides a simple, automated way to achieve CSP compliance without manual refactoring, integrates with popular build tools, and supports advanced CSP features like hash-based strict-dynamic policies.

Overview

Crisper is a utility that processes HTML files by separating inline JavaScript into external files, making it easier to implement Content Security Policy (CSP) restrictions. It helps developers avoid unsafe-inline directives by moving scripts to external resources that can be safely whitelisted.

Key Features

  • Inline Script Extraction — Automatically extracts inline <script> tags from HTML and writes them to a separate .js file.
  • CSP Compliance Support — Enables hash-based or strict-dynamic CSP policies by removing inline scripts that would otherwise require unsafe-inline.
  • Flexible Script Placement — Optionally places the script reference in the <head> (default for performance) or at the end of <body> (for document.write compatibility).
  • Build Tool Integration — Works with Vulcanize for Polymer projects and has plugins for Gulp and Grunt.
  • Hashable Script Loader — Generates a script loader that supports hash-based CSP with strict-dynamic for enhanced security.

Philosophy

Crisper follows a pragmatic approach to CSP compliance, prioritizing security without sacrificing developer workflow by integrating seamlessly with existing build processes.

Use Cases

Best For

  • Implementing Content Security Policy in Polymer applications
  • Automating inline script extraction during build processes
  • Enabling hash-based CSP policies with strict-dynamic
  • Integrating CSP compliance into Gulp or Grunt workflows
  • Processing HTML files from Vulcanize output for CSP readiness
  • Removing unsafe-inline directives from legacy HTML files

Not Ideal For

  • Projects heavily reliant on document.write calls without refactoring, as the default script-in-head setting can cause breakage.
  • Modern single-page applications using frameworks like React or Vue with built-in CSP support or different build systems like Webpack.
  • Teams without a Node.js build process or those seeking runtime script extraction, as Crisper requires static build-time integration.

Pros & Cons

Pros

Automated Script Extraction

Automatically extracts all inline <script> tags from HTML into external files, eliminating the need for unsafe-inline CSP directives and reducing manual effort.

Build Tool Integration

Seamlessly works with Vulcanize for Polymer projects and has official plugins for Gulp and Grunt, making it easy to incorporate into existing build workflows.

Advanced CSP Support

Supports hash-based and strict-dynamic CSP policies via the --csp-hashable-script-loader option, enabling stricter security configurations without compromising functionality.

Performance Optimization

Defaults to placing scripts in the <head> with defer, which improves page load performance by allowing parallel parsing of HTML and JavaScript, as noted in the README.

Cons

Breaking Changes

Version 2.x introduced breaking changes like removing the deprecated split API and changing default behavior, requiring manual adjustments and potentially breaking existing implementations.

Niche Framework Focus

Primarily optimized for Polymer and Vulcanize workflows, making it less versatile for projects using other frameworks or without specific build tool integrations.

Setup Complexity

Requires configuration and integration into build systems like Gulp or Grunt, which can add overhead for simple projects or teams unfamiliar with these tools.

Frequently Asked Questions

Quick Stats

Stars106
Forks22
Contributors0
Open Issues18
Last commit9 years ago
CreatedSince 2015

Tags

#polymer#html-processing#security#content-security-policy#javascript#build-tool

Built With

N
Node.js

Included in

Polymer398
Auto-fetched 1 day ago

Related Projects

lit-htmllit-html

Lit is a simple library for building fast, lightweight web components.

Stars21,732
Forks1,086
Last commit1 month ago
VulcanizeVulcanize

Moved to Polymer/tools monorepo

Stars1,191
Forks128
Last commit8 years ago
Polymer Webpack LoaderPolymer Webpack Loader

WebPack Loader for Polymer Web Components

Stars194
Forks47
Last commit23 days ago
PolyservePolyserve

Moved to Polymer/tools monorepo

Stars189
Forks47
Last commit8 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub