Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Merge g1tusercontent.com: registry answers run nothing in a browser, the site's pages run only their own scripts, repository files and avatars on their own origin, raw files rate limited per address | 1 | import { createContext, useContext } from "react"; |
| 2 | ||
| 3 | /** | |
| 4 | * The nonce the page's inline scripts carry, which its Content-Security-Policy | |
| 5 | * names (lib/page-headers.ts). Given by entry.server.tsx; in the browser | |
| 6 | * there is none, and none is needed: the scripts have already run. | |
| 7 | */ | |
| 8 | export const NonceContext = createContext<string | undefined>(undefined); | |
| 9 | ||
| 10 | export function useNonce(): string | undefined { | |
| 11 | return useContext(NonceContext); | |
| 12 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.