Bug 801066 - s/Unknown Origin/this local file/ in permission prompts when scheme is file. r=pbz,fluent-reviewers,bolsson

Differential Revision: https://phabricator.services.mozilla.com/D197821
This commit is contained in:
Jan-Ivar Bruaroey 2024-01-22 17:02:28 +00:00
Родитель 8e0d21f97a
Коммит bc3deae210
2 изменённых файлов: 27 добавлений и 6 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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 tabs 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 tabs 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 tabs 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 tabs audio and see your screen?
## Variables:
## $origin (String): the first party origin.
## $thirdParty (String): the third party origin.