NotAllowedError: Permission denied Browser Origin: On your device Last updated 15 Oct 2026

Console: NotAllowedError: Permission denied (getUserMedia — camera or microphone blocked)

The user (or the browser/OS/policy) denied camera or microphone access, so navigator.mediaDevices.getUserMedia() was rejected.

Exact message you may see NotAllowedError: Permission deniedNotAllowedError: Permission dismissedgetUserMedia NotAllowedErrorPermission denied by systemNotAllowedError: Permission denied by user agent
Seen on: Chrome Firefox Safari JavaScript

Meaning

Permission can be denied at several layers: the site permission in the browser, the OS privacy setting for the browser, a Permissions-Policy header, or an iframe lacking the allow="camera; microphone" attribute. Reset the site permission and request it again after a user gesture.

Common causes

  • User clicked Block or dismissed the prompt
  • Site permission set to Block in the browser
  • OS-level camera/mic privacy blocks the browser (Windows, macOS)
  • Iframe without allow="camera; microphone" or restrictive Permissions-Policy
  • Not a secure context (HTTP)

⚡ Quick fix

  1. Click the lock icon → Site settings → Camera/Microphone → Allow, then reload
  2. Allow the browser in the OS privacy settings
  3. Serve over HTTPS and add allow="camera; microphone" to iframes

Detailed fix by platform

JavaScript

  1. try { const s = await navigator.mediaDevices.getUserMedia({ video: true, audio: true }); } catch (e) { console.log(e.name, e.message); } — check e.name

Windows

  1. Settings → Privacy & security → Camera / Microphone → allow desktop apps and the browser

macOS

  1. System Settings → Privacy & Security → Camera / Microphone → enable the browser

Code examples

Ask after a click and handle each failure

javascript
button.onclick = async () => {
  try {
    const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
    video.srcObject = stream;
  } catch (e) {
    // NotAllowedError (blocked), NotFoundError (no device), NotReadableError (in use)
    showHelp(e.name);
  }
};

How to diagnose

  1. Name — Exact e.name?
  2. Layers — Browser, OS or iframe policy?
  3. Context — HTTPS?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

autoplay blocked — NotAllowedError: play() failed because the user didn't interact with the document first. (JavaScript)autoplay blockedAw, Snap! — Chrome: Aw, Snap! Something went wrong while displaying this webpage. Error code: STATUS_ACCESS_VIOLATION / SIGILL / Out of Memory (Browser)Aw, Snap!captive portal — Browser: This network requires you to sign in — captive portal (hotel, airport, café Wi-Fi) blocking HTTPS sites (Browser)captive portalGeolocation permission denied — Console: User denied Geolocation / Only secure origins are allowed (geolocation) / GeolocationPositionError code 1 (Browser)Geolocation permissio…NotFoundError: Requested device not found — Console: NotFoundError: Requested device not found (getUserMedia has no camera or microphone) (Browser)NotFoundError: Reques…NotReadableError: Could not start video source — Console: NotReadableError: Could not start video source (camera in use by another app) (Browser)NotReadableError: Cou…Permissions policy violation — Console: [Violation] Permissions policy violation: camera is not allowed in this document (Feature-Policy) (Browser)Permissions policy vi…The canvas has been tainted by cross-origin data — Console: SecurityError: Failed to execute 'toDataURL' / 'getImageData' on 'HTMLCanvasElement': Tainted canvases may not be exported (Browser)The canvas has been t…NotAllowe…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.