Bug 1808431 — Reword first WebMIDI prompt. r=rpl,flod

Differential Revision: https://phabricator.services.mozilla.com/D174813
This commit is contained in:
Bobby Holley 2023-04-06 17:07:14 +00:00
parent 8b9141cc8e
commit bf3806720a
3 changed files with 14 additions and 12 deletions

View File

@ -643,8 +643,12 @@ var gXPInstallObserver = {
let hasHost = !!options.displayURI;
if (isSitePermissionAddon) {
// At present, WebMIDI is the only consumer of the site permission
// add-on infrastructure, and so we can hard-code a midi string here.
// If and when we use it for other things, we'll need to plumb that
// information through. See bug 1826747.
messageString = gNavigatorBundle.getString(
"sitePermissionInstallFirstPrompt.header"
"sitePermissionInstallFirstPrompt.midi.header"
);
} else if (hasHost) {
messageString = gNavigatorBundle.getFormattedString(
@ -675,7 +679,7 @@ var gXPInstallObserver = {
if (isSitePermissionAddon) {
message.textContent = gNavigatorBundle.getString(
"sitePermissionInstallFirstPrompt.message"
"sitePermissionInstallFirstPrompt.midi.message"
);
} else if (hasHost) {
let text = gNavigatorBundle.getString(

View File

@ -43,14 +43,12 @@ xpinstallPromptMessage.neverAllow.accesskey=N
# a localization that's significantly longer than the English version.
xpinstallPromptMessage.neverAllowAndReport=Report Suspicious Site
xpinstallPromptMessage.neverAllowAndReport.accesskey=R
# LOCALIZATION NOTE (sitePermissionInstallFirstPrompt.header)
# This message is shown when a SitePermissionsAddon install is triggered, i.e. when the
# website calls sensitive APIs (e.g. navigator.requestMIDIAccess).
sitePermissionInstallFirstPrompt.header=This site is requesting access to your devices. Device access can be enabled by installing an add-on.
# LOCALIZATION NOTE (sitePermissionInstallFirstPrompt.message)
# This message is shown when a SitePermissionsAddon install is triggered, i.e. when the
# website calls sensitive APIs (e.g. navigator.requestMIDIAccess).
sitePermissionInstallFirstPrompt.message=This add-on could be used to steal your data or attack your computer. Only continue if you trust this site.
# LOCALIZATION NOTE (sitePermissionInstallFirstPrompt.midi.header)
# This message is shown when a website invokes navigator.requestMIDIAccess.
sitePermissionInstallFirstPrompt.midi.header=This site is requesting access to your MIDI (Musical Instrument Digital Interface) devices. Device access can be enabled by installing an add-on.
# LOCALIZATION NOTE (sitePermissionInstallFirstPrompt.midi.message)
# This message is shown when a website invokes navigator.requestMIDIAccess.
sitePermissionInstallFirstPrompt.midi.message=This access is not guaranteed to be safe. Only continue if you trust this site.
# Accessibility Note:
# Be sure you do not choose an accesskey that is used elsewhere in the active context (e.g. main menu bar, submenu of the warning popup button)

View File

@ -92,12 +92,12 @@ add_task(async function testRequestMIDIAccess() {
);
is(
installPopupHeader.textContent,
gNavigatorBundle.getString("sitePermissionInstallFirstPrompt.header"),
gNavigatorBundle.getString("sitePermissionInstallFirstPrompt.midi.header"),
"First popup has expected header text"
);
is(
installPopupMessage.textContent,
gNavigatorBundle.getString("sitePermissionInstallFirstPrompt.message"),
gNavigatorBundle.getString("sitePermissionInstallFirstPrompt.midi.message"),
"First popup has expected message"
);