Sha256: 0a7a41fd9dc6955a8a54f3f59ac0cdda0d9158598fb867df26ebeccf9c9ceb45
Contents?: true
Size: 484 Bytes
Versions: 5
Compression:
Stored size: 484 Bytes
Contents
// This code was heavily inspired by the rails-ujs project. // Copyright (c) 2007-2021 Rails Core team. let nonce = null const loadCSPNonce = () => { if (nonce) { return nonce } const cspMetaTag: HTMLMetaElement = document.querySelector("meta[name=csp-nonce]") if (cspMetaTag) { nonce = cspMetaTag.content } return nonce } // Returns the Content-Security-Policy nonce for inline scripts. export const cspNonce = () => (nonce != null ? nonce : loadCSPNonce())
Version data entries
5 entries across 5 versions & 1 rubygems