JavaScript Navigator presentation Property

Beginner
⏱️ 10 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Experimental

What You’ll Learn

navigator.presentation returns a Presentation object — the entry point for presenting web content on another screen. Learn feature detection, MDN’s receiver vs idle check, defaultRequest, secure contexts, five examples, and try-it labs.

01

Kind

Read-only property

02

Returns

Presentation

03

Status

Experimental

04

Context

Secure (HTTPS)

05

Roles

Controller / receiver

06

Best first step

Feature detect

Introduction

The Presentation API lets a page act as a controller (start or reconnect a presentation) or as a receiver (the page shown on the other display). navigator.presentation is how you reach that API from JavaScript.

MDN notes that today the property is especially useful for feature checking, and on a receiving user agent for accessing PresentationReceiver via navigator.presentation.receiver.

💡
Two contexts, one entry point

A controlling page may set defaultRequest. A receiving page reads receiver. Most everyday tabs are idle controllers with no active receiver.

Understanding the presentation Property

Reading navigator.presentation does not start casting by itself. It returns a Presentation object with role-specific fields:

  • receiverPresentationReceiver in a receiving context; otherwise typically falsy.
  • defaultRequest — optional PresentationRequest for browser-chrome-initiated presentation in a controlling context.
  • Read-only entry point — you do not assign to navigator.presentation.
  • Secure context — HTTPS / localhost where supported.
  • Experimental — not Baseline; support is limited.

📝 Syntax

General form of the property:

JavaScript
navigator.presentation

Value

  • A reference to a Presentation object.

Common patterns

JavaScript
// MDN-style feature check + receiver hint:
if ("presentation" in navigator) {
  const status = navigator.presentation.receiver
    ? "Receiving presentation"
    : "(idle)";
  console.log(status);
} else {
  console.error("Presentation API is not available in this browser.");
}

// Controlling pages may later set:
// navigator.presentation.defaultRequest = new PresentationRequest(urls);

⚡ Quick Reference

GoalCode
Get Presentation objectnavigator.presentation
Feature detect"presentation" in navigator
Receiving?!!navigator.presentation.receiver
Default requestnavigator.presentation.defaultRequest
Secure context?window.isSecureContext
Writable?No (read-only property)
Status (MDN)Experimental / limited availability

🔍 At a Glance

Four facts to remember about navigator.presentation.

Returns
Presentation

API entry point

Status
experimental

Not Baseline

HTTPS
required

Secure context

Best first use
detect

Then branch UX

📋 Controller vs Receiver

Controlling contextReceiving context
RoleStarts / reconnects a presentationShows content on the other screen
receiverTypically falsy / nullPresentationReceiver
defaultRequestMay hold a PresentationRequestMust be null
Everyday tab?Usually yes (idle)Only while presenting
MDN status text(idle) when no receiverReceiving presentation

Examples Gallery

Examples follow MDN navigator.presentation patterns. Prefer Try It Yourself. Many browsers still omit the API.

📚 Getting Started

Detect the API and apply MDN’s receiver status check.

Example 1 — Feature Detection

Check whether presentation exists before using it.

JavaScript
const supported = "presentation" in navigator;
console.log(supported ? "presentation available" : "presentation missing");
Try It Yourself

How It Works

MDN treats this check as the practical first step before any casting UI.

Example 2 — MDN Receiver vs Idle Status

Show whether this browsing context is receiving a presentation.

JavaScript
if ("presentation" in navigator) {
  const status = navigator.presentation.receiver
    ? "Receiving presentation"
    : "(idle)";
  console.log(status);
} else {
  console.error("Presentation API is not available in this browser.");
}
Try It Yourself

How It Works

This matches MDN’s example. Everyday controller tabs almost always print (idle) when the API exists.

📈 Practical Patterns

Secure contexts, field inspection, and a reusable status helper.

Example 3 — Secure Context Check

Presentation features require HTTPS in supporting browsers.

JavaScript
const lines = [];
lines.push("isSecureContext: " + window.isSecureContext);
lines.push(
  "presentation: " +
    ("presentation" in navigator ? "present" : "absent")
);
console.log(lines.join("\n"));
Try It Yourself

How It Works

Secure context is necessary but not sufficient — many engines still omit the property.

Example 4 — Inspect receiver and defaultRequest

Safely describe the main Presentation fields.

JavaScript
function describePresentation() {
  if (!("presentation" in navigator) || !navigator.presentation) {
    return "Presentation API missing";
  }
  const p = navigator.presentation;
  return [
    "receiver: " + (p.receiver ? "yes" : "no"),
    "defaultRequest: " + (p.defaultRequest ? "set" : "null/unset")
  ].join("\n");
}

console.log(describePresentation());
Try It Yourself

How It Works

Useful for debugging cast flows without starting a real secondary display session.

Example 5 — Status Helper for UI

Return a small object your app can render in a footer or settings panel.

JavaScript
function presentationStatus() {
  if (!("presentation" in navigator)) {
    return { ok: false, reason: "api-missing" };
  }
  const receiving = !!navigator.presentation.receiver;
  return {
    ok: true,
    secure: window.isSecureContext,
    receiving,
    label: receiving ? "Receiving presentation" : "(idle)"
  };
}

console.log(JSON.stringify(presentationStatus(), null, 2));
Try It Yourself

How It Works

Keep casting as progressive enhancement: when ok is false, hide cast buttons and keep the main page experience.

🚀 Common Use Cases

  • Feature detection — show Cast / Present only when the API exists.
  • Receiver pages — detect receiver and wire presentation messaging.
  • Controller defaults — set defaultRequest for browser chrome casting menus.
  • Diagnostics — include presentation availability in support debug panels.
  • Not universal casting — keep non-API fallbacks for unsupported browsers.

🧠 How navigator.presentation Works

1

Feature-detect the entry point

Check "presentation" in navigator on HTTPS.

Detect
2

Receive a Presentation object

Controller and receiver contexts share this entry point.

Presentation
3

Branch on role

Use receiver or set defaultRequest as needed.

Role
4

Keep a fallback UI

When missing, continue with normal single-screen UX.

📝 Notes

  • Experimental Presentation API — not Baseline / limited availability (MDN).
  • Secure context required where the property is exposed.
  • Read-only entry point returning a Presentation object.
  • Most useful first for feature detection and receiver access.
  • Related: preferences, product, Window, JavaScript hub.

Limited / Experimental Support

navigator.presentation belongs to the experimental Presentation API and is not Baseline. Support is limited. Always feature-detect, use HTTPS, and keep a single-screen fallback.

Experimental · Not Baseline

Navigator.presentation

Safe to explore for learning cast / secondary-display flows. Do not require it for core app functionality.

Limited Experimental
Google Chrome Partial / evolving Presentation API support
Limited
Microsoft Edge Follow Chromium Presentation API status
Limited
Opera Follow Chromium Presentation API status
Limited
Mozilla Firefox Typically unavailable for this API path
Unavailable
Apple Safari Typically unavailable for this API path
Unavailable
Internet Explorer No Presentation API support
Unavailable
presentation Limited

Bottom line: Detect navigator.presentation, check receiver vs idle, and hide casting UI when the API is missing.

Conclusion

navigator.presentation is the experimental entry point to the Presentation API. Feature-detect it, use MDN’s receiver vs idle check, remember HTTPS, and keep casting as an optional enhancement.

Continue with product, preferences, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect before using Presentation APIs
  • Serve demos over HTTPS
  • Branch UI for controller vs receiver contexts
  • Keep a normal single-screen experience
  • Treat casting as progressive enhancement

❌ Don’t

  • Assume every browser exposes presentation
  • Require casting for core content
  • Skip secure-context requirements
  • Try to assign to navigator.presentation
  • Confuse idle controllers with receiving pages

Key Takeaways

Knowledge Unlocked

Five things to remember about presentation

Experimental Presentation entry point — detect, then enhance.

5
Core concepts
🔍 02

Detect

"presentation" in navigator

Safe
⚗️ 03

Status

experimental

Caution
🔒 04

HTTPS

secure context

Security
🎦 05

Roles

idle / receiving

UX

❓ Frequently Asked Questions

It is a read-only Navigator property that returns a Presentation object — the entry point to the Presentation API for controlling or receiving presentations on secondary displays.
The Presentation API / Presentation interface is experimental and not Baseline. MDN marks navigator.presentation as limited availability. Always feature-detect and keep a non-presentation fallback UX.
Yes in supporting browsers: it is available only in secure contexts (HTTPS or localhost).
On a receiving browsing context, navigator.presentation.receiver returns a PresentationReceiver. On a normal controlling page it is typically null / falsy — MDN’s example shows “Receiving presentation” vs “(idle)”.
In a controlling context you can set navigator.presentation.defaultRequest to a PresentationRequest so the browser can use it for chrome-initiated casting. In a receiving context it is null.
No. The property is read-only. You use fields on the returned Presentation object (such as defaultRequest and receiver).
Did you know?

Setting navigator.presentation.defaultRequest does not by itself cast your page. It tells a supporting controlling browser which PresentationRequest to use if the user starts presentation from browser chrome (for example a cast menu).

Learn product Next

Always returns Gecko — a legacy Navigator compatibility string.

product →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful