diff --git a/browser/actors/WebRTCParent.sys.mjs b/browser/actors/WebRTCParent.sys.mjs index f3e956ff52cf..09c39e739315 100644 --- a/browser/actors/WebRTCParent.sys.mjs +++ b/browser/actors/WebRTCParent.sys.mjs @@ -571,11 +571,18 @@ function prompt(aActor, aBrowser, aRequest) { reqAudioOutput, !!aRequest.secondOrigin ); - const message = localization.formatValueSync(stringId, { - origin: "<>", - thirdParty: "{}", - }); - + let message; + let originToShow; + if (principal.schemeIs("file")) { + message = localization.formatValueSync(stringId + "-with-file"); + originToShow = null; + } else { + message = localization.formatValueSync(stringId, { + origin: "<>", + thirdParty: "{}", + }); + originToShow = lazy.webrtcUI.getHostOrExtensionName(principal.URI); + } let notification; // Used by action callbacks. const actionL10nIds = [{ id: "webrtc-action-allow" }]; @@ -714,7 +721,7 @@ function prompt(aActor, aBrowser, aRequest) { } let options = { - name: lazy.webrtcUI.getHostOrExtensionName(principal.URI), + name: originToShow, persistent: true, hideClose: true, eventCallback(aTopic, aNewBrowser, isCancel) { diff --git a/browser/locales/en-US/browser/webrtcIndicator.ftl b/browser/locales/en-US/browser/webrtcIndicator.ftl index 7601a2a04b9d..5b48a9bc51b4 100644 --- a/browser/locales/en-US/browser/webrtcIndicator.ftl +++ b/browser/locales/en-US/browser/webrtcIndicator.ftl @@ -139,6 +139,20 @@ webrtc-allow-share-camera-and-audio-capture = Allow { $origin } to use your came webrtc-allow-share-screen-and-microphone = Allow { $origin } to use your microphone and see your screen? webrtc-allow-share-screen-and-audio-capture = Allow { $origin } to listen to this tab’s audio and see your screen? +## Special phrasing for sharing devices when the origin is a file url. + +webrtc-allow-share-audio-capture-with-file = Allow this local file to listen to this tab’s audio? +webrtc-allow-share-camera-with-file = Allow this local file to use your camera? +webrtc-allow-share-microphone-with-file = Allow this local file to use your microphone? +webrtc-allow-share-screen-with-file = Allow this local file to see your screen? +# "Speakers" is used in a general sense that might include headphones or +# another audio output connection. +webrtc-allow-share-speaker-with-file = Allow this local file to use other speakers? +webrtc-allow-share-camera-and-microphone-with-file = Allow this local file to use your camera and microphone? +webrtc-allow-share-camera-and-audio-capture-with-file = Allow this local file to use your camera and listen to this tab’s audio? +webrtc-allow-share-screen-and-microphone-with-file = Allow this local file to use your microphone and see your screen? +webrtc-allow-share-screen-and-audio-capture-with-file = Allow this local file to listen to this tab’s audio and see your screen? + ## Variables: ## $origin (String): the first party origin. ## $thirdParty (String): the third party origin.