-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport-uri.min.js
More file actions
2 lines (2 loc) · 1.34 KB
/
report-uri.min.js
File metadata and controls
2 lines (2 loc) · 1.34 KB
1
2
/*! Markup Cookie Consent Policy | @version 1.1.2 | @author NB Communication Ltd <info@nbcommunication.com> | @copyright 2021 | @license Mozilla Public License v2.0 http://mozilla.org/MPL/2.0/ | Send a report if the policy is violated. For more information on this event please visit https://developer.mozilla.org/en-US/docs/Web/API/SecurityPolicyViolationEvent */
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define("markup-cookie-consent-policy",o):(e="undefined"!=typeof globalThis?globalThis:e||self).markupCookieConsentPolicy=o()}(this,(function(){"use strict";var e="securitypolicyviolation",o="localStorage"in window,i=o?window.localStorage.getItem(e):null,t=o&&i?i.split("|"):[];return document.addEventListener(e,(function(i){for(var n={},l=["blockedURI","columnNumber","disposition","documentURI","effectiveDirective","lineNumber","originalPolicy","referrer","sample","sourceFile","statusCode","violatedDirective"],r=0;r<l.length;r++)n[l[r]]=i[l[r]];var c=n.effectiveDirective+":"+n.blockedURI+"["+n.lineNumber+","+n.columnNumber+"]";if(-1===t.indexOf(c)){t.push(c),o&&window.localStorage.setItem(e,t.join("|"));var s=new XMLHttpRequest;s.open("POST","?csp-violations=1",!0),s.setRequestHeader("Content-Type","application/csp-report"),s.send(JSON.stringify(n))}})),function(){}}));