Scan Current Browser Permissions
Reads the current state of 6 browser permissions (camera, microphone, geolocation, notifications, clipboard-read, persistent-storage) without showing any permission popups.
Delegated Authority · Replayable Browser Permission Audits
When third-party scripts, widgets, or browser extensions try to touch your camera, microphone, location, or USB devices, it is hard to see which step requested access and whether your HTTP rules blocked it. This workbench inspects live Permissions API states without triggering popups, runs probes inside an HTTP Permissions-Policy iframe, captures browser ReportingObserver and Reporting-Endpoints reports, and saves replayable JSONL logs in the Origin Private File System (OPFS).
Unattended scripts and embedded iframes can probe sensitive hardware APIs silently, and standard JavaScript errors do not separate a user denial from an HTTP policy block or link the violation back to the script step that triggered it.
Teams can record, export, and re-import permission traces as plain .jsonl files, then test tighter Permissions-Policy or Report-Only rules offline before rolling them out—while surfacing silent denials that never emit a browser violation report.
Run the three steps below to scan six browser permissions without popups, fire a 4-step probe inside a restricted iframe to correlate violation reports, and save or diff the perm-journal.jsonl log in local OPFS storage. Then edit the policy matrix to replay old traces against stricter rules.
Run these three checks in order to inspect your browser's current permissions, trigger real HTTP policy blocks inside a child iframe, and verify the local audit file.
Reads the current state of 6 browser permissions (camera, microphone, geolocation, notifications, clipboard-read, persistent-storage) without showing any permission popups.
Sends camera, microphone, geolocation, and WebUSB requests inside the restricted /probe/restricted-policy iframe to compare captured ReportingObserver violations against silent denials.
Writes perm-journal.jsonl to your browser's private local file system (OPFS), reads it back line by line, and checks that the on-disk trace matches memory.
Combines passive browser permission queries with actual iframe blocks so you can spot which blocked calls emitted a report and which failed silently.
| Capability | Policy Directive | Browser Query State | Iframe Policy | Replay Attempts | Violations | Effective Posture |
|---|
Toggle iframe sandboxing or parent delegation below, trigger individual hardware probes, and see which step produced each violation report.
/probe/restricted-policy
loading...
| Step | Tool | Feature | Origin Frame | Delta | Disposition |
|---|---|---|---|---|---|
| No ReportingObserver violations correlated yet. Run Step 2 to execute probes inside /probe/restricted-policy. | |||||
replayRun())Change any feature between deny, allow, and report-only—or import a saved .jsonl trace—to preview which steps would flip from allowed to blocked.
Permissions-Policy: camera=(), microphone=(), geolocation=(), usb=(), clipboard-read=(self), payment=()
0 outcome flips
| Step | Capability | Recorded | Replayed | Status | Policy Evaluation Reason |
|---|---|---|---|---|---|
| Record steps with Step 1 or Step 2, edit any capability policy above, then click Replay Stored Trace Against Policy. | |||||
Inspect the raw newline-delimited audit log, live HTTP policy headers, browser violation reports, and server-collected batches stored in SQLite.
perm-journal.jsonl)
Live In-Memory JSONL Stream (serializeJsonl(entries))
# Empty journal. Scan permissions or replay tool sequence to emit JSONL records.
OPFS Persisted File vs In-Memory Diff (perm-journal.jsonl)
# Persist to OPFS (Step 3) to inspect line-by-line disk vs memory diff.
GET / & GET /probe/restricted-policy)
Measured HTTP Response Headers
Fetching live headers from / and /probe/restricted-policy...
Raw Serialized ReportingObserver Events (report.toJSON())
[]
GET /api/report/:runId · Durable Object)
[]
correlateViolationsToStep() + summarizePolicyPosture())
{}
HTTP Boundary Headers Served by Worker
GET /Content-Security-Policy: ... frame-ancestors 'self' https://aifoc.us https://*.aifoc.us http://localhost:* http://127.0.0.1:*; frame-src 'self';GET /probe/restricted-policyPermissions-Policy: camera=(), microphone=(), geolocation=(), usb=(), payment=() (plus optional ?policy=report-only|camera-only|custom)Probe CSP frame-ancestorsframe-ancestors 'self' https://aifoc.us https://*.aifoc.us http://localhost:* http://127.0.0.1:* (required for nested embedding inside aifoc.us)Reporting-Endpointsdefault="<origin>/api/report/<runId>" (backed by SQLite Durable Object ReportCollector)POST / GET / DELETE /api/report/:runIdapplication/reports+json batches (204 No Content), lists stored reports as JSON, or clears the session log.
Automated scripts, extensions, and embedded tool frames invoke media, geolocation, clipboard, or WebUSB APIs
across document boundaries. When an HTTP Permissions-Policy header or browser permission blocks a
call, standard exceptions do not link the violation report back to the tool step ID and frame origin that
initiated it.
Produce a verifiable capability trace before and during tool execution: query non-prompting
navigator.permissions.query() states, test header-enforced isolation in
/probe/restricted-policy, flag silent denials lacking a violation report, and bind every
enforcement event to a structured JSONL audit log.
The probe iframe registers a ReportingObserver, serializes violation reports with
.toJSON() to avoid DataCloneError, and forwards payloads over
postMessage. correlateViolationsToStep() matches directive, origin, and
timestamp delta to each tool step before writing perm-journal.jsonl to OPFS.
navigator.permissions.query()
step-01..04) with tool name and correlation IDsandbox="allow-scripts" and parent allow rules/probe/restricted-policyPermissions-Policy sets the maximum allowed featurescamera, microphone, geolocation, and usbReportingObserver captures browser violation reports via .toJSON()replayRun(entries, editedMatrix)
opfs://perm-journal.jsonl
serializeJsonl() and parseJsonl() round-trip with line-by-line disk diff.
Permissions-Policy header enforcement inside the child iframe, ReportingObserver serialization, policy matrix replay via replayRun(), and OPFS JSONL persistence.
Query capability state before invocation with navigator.permissions.query(), isolate sub-frame execution behind HTTP Permissions-Policy headers, capture ReportingObserver violations, and persist correlated traces as OPFS JSONL records (perm-journal.jsonl).
// Direct device calls trigger unlogged prompts or throw opaque errors across frames
async function captureFrame() {
try {
// No pre-flight permission query, no frame policy check, and no audit log
const stream = await navigator.mediaDevices.getUserMedia({ video: true });
return stream.getVideoTracks()[0];
} catch (err) {
// Cannot separate user denial from HTTP Permissions-Policy enforcement
console.warn("Capture failed:", err.name);
return null;
}
}
// public/app.js + public/probe-client.js — query, observe violations, persist OPFS JSONL
const status = await navigator.permissions.query({ name: "camera" });
const allowedByFrame = document.permissionsPolicy?.allowsFeature("camera") ?? null;
const observer = new ReportingObserver(
(reports) => reports.forEach((r) => forwardReport(r.toJSON())),
{ types: ["permissions-policy-violation", "feature-policy-violation"], buffered: true },
);
observer.observe();
// Persist correlated records to Origin Private File System as newline-delimited JSON
const root = await navigator.storage.getDirectory();
const handle = await root.getFileHandle("perm-journal.jsonl", { create: true });
const writable = await handle.createWritable();
await writable.write(serializeJsonl(correlated.entries));
await writable.close();
End-to-end wiring from the restricted probe <iframe> in public/index.html, the PERMISSION_PROBES matrix and OPFS JSONL record schema in public/lib/perm-journal.js, ReportingObserver forwarding in public/probe-client.js & public/app.js, and Permissions-Policy + Reporting-Endpoints headers in src/worker.ts.
<!-- 1. Page HTML Setup (public/index.html) -->
<button type="button" id="btn-scan-permissions">Scan Permissions Matrix</button>
<button type="button" id="btn-run-replay">Replay Tool Script in Iframe</button>
<button type="button" id="btn-persist-opfs">Persist & Diff OPFS JSONL</button>
<iframe id="probe-frame" class="probe-iframe" src="/probe/restricted-policy" title="Restricted Permissions-Policy Probe Frame"></iframe>
<script type="module" src="/app.js"></script>
// 2. Audited Permission List & OPFS JSONL Entry (public/lib/perm-journal.js)
export const PERMISSION_PROBES = [
{ name: "camera", policyDirective: "camera", apiSurface: "navigator.mediaDevices.getUserMedia({ video: true })", iframeProbe: true },
{ name: "microphone", policyDirective: "microphone", apiSurface: "navigator.mediaDevices.getUserMedia({ audio: true })", iframeProbe: true },
{ name: "geolocation", policyDirective: "geolocation", apiSurface: "navigator.geolocation.getCurrentPosition()", iframeProbe: true },
{ name: "notifications", policyDirective: null, apiSurface: "Notification.requestPermission()", iframeProbe: false },
{ name: "clipboard-read", policyDirective: "clipboard-read", apiSurface: "navigator.clipboard.readText()", iframeProbe: false },
{ name: "persistent-storage", policyDirective: null, apiSurface: "navigator.storage.persist()", iframeProbe: false },
];
const journalEntry = createJournalEntry({
step: "tool-01",
toolName: "media.capture_video_frame",
origin: window.location.origin,
permissionName: "camera",
state: "policy-blocked",
source: "permissions-policy-iframe",
detail: 'NotAllowedError: Permissions policy "camera" blocked.',
ts: Date.now(),
frameUrl: `${window.location.origin}/probe/restricted-policy`,
correlationId: "tool-01:camera:req-1",
});
// 3. Iframe ReportingObserver Forwarding & OPFS Persistence (public/probe-client.js + public/app.js)
new ReportingObserver(
(reports) => reports.forEach((r) => window.parent.postMessage({ kind: "probe:violation-report", report: r.toJSON() }, location.origin)),
{ types: ["permissions-policy-violation", "feature-policy-violation"], buffered: true },
).observe();
state.correlationResult = correlateViolationsToStep(state.rawEntries, state.reportEvents);
const root = await navigator.storage.getDirectory();
const handle = await root.getFileHandle("perm-journal.jsonl", { create: true });
const writable = await handle.createWritable();
await writable.write(serializeJsonl(state.correlationResult.entries));
await writable.close();
// src/worker-routes.ts — HTTP response headers served on GET /probe/restricted-policy?runId=...:
// Permissions-Policy: camera=(), microphone=(), geolocation=(), usb=(), payment=()
// Reporting-Endpoints: default="https://<origin>/api/report/<runId>"
// Content-Security-Policy: default-src 'self'; frame-ancestors 'self' https://aifoc.us ...;
// public/lib/perm-journal.js — correlate violations & count silent reporting gaps
const entry = createJournalEntry({
step: "tool-01",
toolName: "media.capture_video_frame",
origin: window.location.origin,
permissionName: "camera",
state: "policy-blocked",
source: "permissions-policy-iframe",
frameUrl: `${window.location.origin}/probe/restricted-policy`,
correlationId,
});
const { entries, correlations } = correlateViolationsToStep([entry], reportEvents);
const posture = summarizePolicyPosture(permissionStates, entries);
// posture.journalStats.silentPolicyBlocks counts blocked steps with 0 ReportingObserver records
Uninstrumented getUserMedia and getCurrentPosition calls that trigger surprise prompts or fail silently without attribution across nested iframes.
Pre-flight PermissionStatus queries, HTTP Permissions-Policy allowlists per frame, ReportingObserver violation records, silent reporting gaps, and reproducible OPFS JSONL audit journals.
Not all capabilities expose navigator.permissions.query() names or document.permissionsPolicy.allowsFeature() uniformly across browsers, some policy blocks omit ReportingObserver entries, and child-frame reports require explicit postMessage forwarding.
Permissions-PolicyReporting-Endpointsapplication/reports+json) asynchronously.ReportingObservernavigator.permissions.query())granted, denied, or prompt without popping up a permission dialog..jsonl) audit traces.ReportCollector)