{"id":409,"date":"2019-07-01T15:41:00","date_gmt":"2019-07-01T15:41:00","guid":{"rendered":"https:\/\/blog.mozilla.org\/webrtc\/?p=409"},"modified":"2019-07-14T16:03:12","modified_gmt":"2019-07-14T16:03:12","slug":"camera-microphone-require-https-in-firefox-68","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/","title":{"rendered":"Camera &amp; microphone require https in Firefox 68."},"content":{"rendered":"<p>As of Firefox 68\u2014releasing next week\u2014camera and microphone will require an <code>https<\/code> connection to work. Access from insecure <code>http<\/code> will cease to work, matching how Chrome works. Camera and microhone are powerful features, and Firefox will now only expose them in <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/Security\/Secure_Contexts\">secure contexts<\/a>, a security and privacy improvement.<\/p>\n<p>Largely an <a href=\"https:\/\/www.fxsitecompat.dev\/en-CA\/docs\/2019\/getusermedia-and-enumeratedevices-can-no-longer-be-used-on-insecure-sites\/\">issue for developers to catch up on<\/a>, this may nonetheless affect end users who follow old <code>http<\/code> links to servers that either still don&#8217;t <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Headers\/Strict-Transport-Security\">redirect their users<\/a> to <code>https<\/code> automatically, or don&#8217;t support it at all. If you&#8217;re experiencing this problem, click your URL bar, and if the URL starts with <code>http<\/code>, try changing it to <code>https<\/code>, and it should work again, provided the server supports https.<\/p>\n<p>The rest of this blog post is for web developers, since there are some details that may be of interest to them. Firefox is deprecating camera and microphone access in <strong>insecure contexts<\/strong> in two steps: <!--more--><\/p>\n<h3>Firefox 68 behavior<\/h3>\n<p>In Firefox 68, <code>getUserMedia<\/code> will still be there, but the promise returned from it <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Mozilla\/Firefox\/Releases\/68#APIs\">will always be rejected with<\/a> <code>NotAllowedError<\/code>, while <code>enumerateDevices<\/code> will continue to work until Firefox 69. This matches how Chrome has worked for a good while (pre Chrome 74), and should be highly web compatible. It is an intermediate stepping stone to Firefox 69.<\/p>\n<h3>Firefox 69 behavior<\/h3>\n<p>In Firefox 69, both <code>getUserMedia<\/code> and <code>enumerateDevices<\/code> will throw <code>TypeError<\/code>. This matches how Chrome 74+ and the <a href=\"https:\/\/w3c.github.io\/mediacapture-main\/getusermedia.html#idl-def-mediadevices\">the spec<\/a> now work.<\/p>\n<p>It is worth pointing out that this <code>TypeError<\/code> exception will come from the absence of the <code>navigator.mediaDevices<\/code> object in insecure contexts\u2014or, if callbacks are used, the absence of the deprecated <code>navigator.mozGetUserMedia<\/code> function. Any JavaScript that doesn&#8217;t test for this before invoking <code>navigator.mediaDevices.getUserMedia()<\/code> will get an immediate exception thrown instead of merely having its promise rejected. Compared to Firefox 68, this might affect surrounding code, hence the two-step process.<\/p>\n<h3>How SecureContext improves things<\/h3>\n<p>Some good news for web developers is that camera and microphone will continue to work from <code>http:\/\/localhost<\/code>! This is thanks to the modern definition of secure context, which <a href=\"https:\/\/w3c.github.io\/webappsec-secure-contexts\/#localhost\">defines local sources as secure<\/a>. It also fixes other edge cases, like an <code>https<\/code> iframe in an <code>http<\/code> page is now considered insecure. It also cleans up camera and microphone access from embedded JS using <code>srcdoc<\/code> (works) and <code>data:<\/code> URLs (no longer works).<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"As of Firefox 68\u2014releasing next week\u2014camera and microphone will require an https connection to work. Access from insecure http will cease to work, matching how Chrome works. Camera and microhone are powerful features, and Firefox will now only expose them in secure contexts, a security and privacy improvement. Largely an issue for developers to catch [&hellip;]","protected":false},"author":1399,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"coauthors":[301098],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Camera &amp; microphone require https in Firefox 68. - Advancing WebRTC<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Camera &amp; microphone require https in Firefox 68. - Advancing WebRTC\" \/>\n<meta property=\"og:description\" content=\"As of Firefox 68\u2014releasing next week\u2014camera and microphone will require an https connection to work. Access from insecure http will cease to work, matching how Chrome works. Camera and microhone are powerful features, and Firefox will now only expose them in secure contexts, a security and privacy improvement. Largely an issue for developers to catch [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/\" \/>\n<meta property=\"og:site_name\" content=\"Advancing WebRTC\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-01T15:41:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-14T16:03:12+00:00\" \/>\n<meta name=\"author\" content=\"Jan-Ivar Bruaroey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jan-Ivar Bruaroey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/\",\"url\":\"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/\",\"name\":\"Camera &amp; microphone require https in Firefox 68. - Advancing WebRTC\",\"isPartOf\":{\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#website\"},\"datePublished\":\"2019-07-01T15:41:00+00:00\",\"dateModified\":\"2019-07-14T16:03:12+00:00\",\"author\":{\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/f2eb9712b8d85b70aebe1faf24e731fd\"},\"breadcrumb\":{\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.mozilla.org\/webrtc\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Camera &amp; microphone require https in Firefox 68.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#website\",\"url\":\"https:\/\/blog.mozilla.org\/webrtc\/\",\"name\":\"Advancing WebRTC\",\"description\":\"Committed to moving Firefox and WebRTC forward\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.mozilla.org\/webrtc\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/f2eb9712b8d85b70aebe1faf24e731fd\",\"name\":\"Jan-Ivar Bruaroey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/image\/5f3d49a61b032619d0d33c4cc7c7433f\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/16d7e05dc9f8a855a02e0796b00aad3f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/16d7e05dc9f8a855a02e0796b00aad3f?s=96&d=mm&r=g\",\"caption\":\"Jan-Ivar Bruaroey\"},\"url\":\"https:\/\/blog.mozilla.org\/webrtc\/author\/jbruaroeymozilla-com\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Camera &amp; microphone require https in Firefox 68. - Advancing WebRTC","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/","og_locale":"en_US","og_type":"article","og_title":"Camera &amp; microphone require https in Firefox 68. - Advancing WebRTC","og_description":"As of Firefox 68\u2014releasing next week\u2014camera and microphone will require an https connection to work. Access from insecure http will cease to work, matching how Chrome works. Camera and microhone are powerful features, and Firefox will now only expose them in secure contexts, a security and privacy improvement. Largely an issue for developers to catch [&hellip;]","og_url":"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/","og_site_name":"Advancing WebRTC","article_published_time":"2019-07-01T15:41:00+00:00","article_modified_time":"2019-07-14T16:03:12+00:00","author":"Jan-Ivar Bruaroey","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jan-Ivar Bruaroey","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/","url":"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/","name":"Camera &amp; microphone require https in Firefox 68. - Advancing WebRTC","isPartOf":{"@id":"https:\/\/blog.mozilla.org\/webrtc\/#website"},"datePublished":"2019-07-01T15:41:00+00:00","dateModified":"2019-07-14T16:03:12+00:00","author":{"@id":"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/f2eb9712b8d85b70aebe1faf24e731fd"},"breadcrumb":{"@id":"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.mozilla.org\/webrtc\/camera-microphone-require-https-in-firefox-68\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.mozilla.org\/webrtc\/"},{"@type":"ListItem","position":2,"name":"Camera &amp; microphone require https in Firefox 68."}]},{"@type":"WebSite","@id":"https:\/\/blog.mozilla.org\/webrtc\/#website","url":"https:\/\/blog.mozilla.org\/webrtc\/","name":"Advancing WebRTC","description":"Committed to moving Firefox and WebRTC forward","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.mozilla.org\/webrtc\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/f2eb9712b8d85b70aebe1faf24e731fd","name":"Jan-Ivar Bruaroey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.mozilla.org\/webrtc\/#\/schema\/person\/image\/5f3d49a61b032619d0d33c4cc7c7433f","url":"https:\/\/secure.gravatar.com\/avatar\/16d7e05dc9f8a855a02e0796b00aad3f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/16d7e05dc9f8a855a02e0796b00aad3f?s=96&d=mm&r=g","caption":"Jan-Ivar Bruaroey"},"url":"https:\/\/blog.mozilla.org\/webrtc\/author\/jbruaroeymozilla-com\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/posts\/409"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/users\/1399"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/comments?post=409"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/posts\/409\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/media?parent=409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/categories?post=409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/tags?post=409"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mozilla.org\/webrtc\/wp-json\/wp\/v2\/coauthors?post=409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}