PageSourceSearch

https://www.theunion.com/shared-content/art/tncms/api/csrf.js

js theunion.com collected 2026-09-24 09:00:45 UTC 1,008 bytes, 2 lines download raw bytes

1document.addEventListener("DOMContentLoaded",function(){function s(t){let n=document.cookie.split(";");for(let e=0;e<n.length;e++){let o=n[e].split("=");if(t===o[0].trim())return decodeURIComponent(o[1])}return null}function i(t,n){let e=t.getAttribute("method");if(e&&e.toUpperCase()==="GET")return;if(!t.querySelector("input[name='tncms_csrf_token']")){let c=document.createElement("input");c.type="hidden",c.name="tncms_csrf_token",c.value=n,t.prepend(c)}}function u(t){document.querySelectorAll("form").forEach(function(e){i(e,t)})}function f(){fetch("/tncms/csrf/token/",{method:"GET",credentials:"same-origin"}).then(()=>{let t=s("tncms_csrf_token");t&&u(t)})}let r=s("tncms_csrf_token");r?u(r):f(),new MutationObserver(function(t){t.forEach(function(n){n.type==="childList"&&n.addedNodes.forEach(function(e){e.tagName==="FORM"?i(e,r):e.querySelectorAll&&e.querySelectorAll("form").forEach(function(o){i(o,r)})})})}).observe(document.body,{childList:!0,subtree:!0})});
2//# sourceMappingURL=csrf.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.